I am trying to make a config that does a batch of indexing, then an elasticsearch filter query to find documents that need an update to be marked as stale (via a new event created in a subsequent ruby filter). It's important that my filter runs after all indexing is complete.
What I have found is that applying a filter (any filter, it seems) disrupts the expected order the events are processed. At least, the order they are output is disrupted. A simple config that demonstrates the behavior is the following:
input {
generator {
count => 1
lines => ["1", "2"]
}
}
filter {
if [message] == "2" {
mutate {
add_field => { "foo" => "blah" }
}
}
}
output {
stdout { codec => rubydebug }
}
With the filter active, the event for the second line (the only one the filter is applied to) is output first. With the filter disabled, the events are output in the expected order. Can anyone explain what is going on?
