mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
two grep filter bugfixes
- if we receive a message with an unknown type, drop it - break on first match if there are multiple values (faster & keeps match_count right)
This commit is contained in:
parent
f2d5258115
commit
e0594f73c1
1 changed files with 2 additions and 0 deletions
|
@ -33,6 +33,7 @@ class LogStash::Filters::Grep < LogStash::Filters::Base
|
|||
config = @config[event.type]
|
||||
if not config
|
||||
@logger.debug("grep: skipping type #{event.type} from #{event.source}")
|
||||
event.cancel
|
||||
return
|
||||
end
|
||||
|
||||
|
@ -54,6 +55,7 @@ class LogStash::Filters::Grep < LogStash::Filters::Base
|
|||
next unless re.match(value)
|
||||
@logger.debug("grep matched on field #{field}")
|
||||
match_count += 1
|
||||
break
|
||||
end
|
||||
end # match["match"].each
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue