mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
- handle cases where tags are not present in an event (LOGSTASH-1286)
This commit is contained in:
parent
86ba753692
commit
35da10f566
1 changed files with 2 additions and 1 deletions
|
@ -65,13 +65,14 @@ class LogStash::Outputs::Base < LogStash::Plugin
|
|||
end
|
||||
|
||||
if !@tags.empty?
|
||||
return false if !event["tags"]
|
||||
if !@tags.send(@include_method) {|tag| event["tags"].include?(tag)}
|
||||
@logger.debug? and @logger.debug("Dropping event because tags don't match #{@tags.inspect}", event)
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
if !@exclude_tags.empty?
|
||||
if !@exclude_tags.empty? && event["tags"]
|
||||
if @exclude_tags.send(@exclude_method) {|tag| event["tags"].include?(tag)}
|
||||
@logger.debug? and @logger.debug("Dropping event because tags contains excluded tags: #{exclude_tags.inspect}", event)
|
||||
return false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue