Hi all,
I'm new here, hope to get some help
I'm working using the logstash pipeline, for instance, I have rabbitmq as input for my logs and Elastisearch as output. Fantastic!
The problem is in the elasticsearch filter I'm using: with an if statement, if I receive a specific log class I have to look inside elasticsearch for previous logs that have the same "id" as the one that just arrived. If I found the result, I need to attach all the information from the query result into the new log, like an extension of this log with more information.
The problem is I'm not understanding the good way to query elasticsearch using "query_template" and another problem is how to make this more dynamic in term of: how do I specify my key value dynamically ?
here is my query template
{ "query": { "bool": { "must":[{ "match":{ "id": "871df49c-acad-11e6-80f5-76304dec7eb7" --- this is the value that always changes, so i can't put static value } } ] } }, "_source": ["@id", "started"] -- and here i want to add the information from the previous log i found into a new fileld "started" for example, in the new log. But in my case I would love to add all the fields at once.
}
Hope I clearly explained my issue and hope to get some help!
Thank you