How can I check index exists in logstash filter and how can get dynamic field from elasticsearch lookup( in filter plugin)


How can i check index exists in "Elasticsearch filter plugin". My situation is taht i am getting old data from elasticsearch to subtract from current record but in case if that index doesn't exist then i want to subtract 0. Currently Its throwing error if index doesn't exist. I need to know how can i check if index exist in elasticsearch filter so i can handle it.

Q2: Is there a way to do get filter lookup field by dynamic name like

elasticsearch {

hosts => "localhost:9200"

index => "ptc-db-perfhealth-baseline2"

query_template => "tmp-aggs.json"

fields => {

"[stats %{[cntrName]}]" => "[@metadata][stats]"



for me its not working. I know this syntax works for add_field

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.