Skip to content

Commit

Permalink
fix event.tags usage on sort filter
Browse files Browse the repository at this point in the history
  • Loading branch information
nickethier committed Sep 26, 2013
1 parent 8981ab2 commit 0a70575
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/logstash/filters/sort.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def filter(event)
end

# if the event is sorted, a "sorted" tag will be marked, so for those unsorted event, cancel them first.
if event.tags.nil? || !event.tags.include?("sorted")
if event["tags"].nil? || !event.tags.include?("sorted")
event.cancel
else
return
Expand All @@ -73,8 +73,8 @@ def filter(event)

if (@sortingDone)
while sortedEvent = @sortingArray.pop
sortedEvent.tags = Array.new if sortedEvent.tags.nil?
sortedEvent.tags << "sorted"
sortedEvent["tags"] = Array.new if sortedEvent["tags"].nil?
sortedEvent["tags"] << "sorted"
filter_matched(sortedEvent)
yield sortedEvent
end # while @sortingArray.pop
Expand All @@ -101,7 +101,7 @@ def flush
if (@sortingDone)
@mutex.synchronize{
while sortedEvent = @sortingArray.pop
sortedEvent.tags << "sorted"
sortedEvent["tags"] << "sorted"
events << sortedEvent
end # while @sortingArray.pop
}
Expand Down

0 comments on commit 0a70575

Please sign in to comment.