Hi all, I've a problem when trying to check if a query, done inside the elasticsearch filter plugin, returns me a document. How can i check this situation? Currently I'm using the fields attribute to map old event inside a new one but when I check the value it always fails. Any suggestion?
Logstash version 6.3, Elasticsearch filter plugin version 3.3.0.
The code I use is the following:
`
filter{
elasticsearch {
hosts => ["es-server"]
index => "index"
type => "type"
query => "template.json"
fields => { "username" => "doc_result" }
}
}
output{
if[doc_result]{...}
}
`
In this case when the query match a document I assign the value username of the document returned into the doc_result variable, but for an unknown reason the if in the output will always fail. Anyone knows how to solve this problem? I'm going crazy over this thing. Thanks to all.