Hi,
Is there any way to get event.sprintf to print the entire event, not just individual fields? I'm trying to build a percolator query that contains the entire logstash event.
What I'd like my percolator query to look like:
{
"query" : {
"percolate" : {
"field" : "query",
"document_type" : "doctype",
"document": { <THE ENTIRE LOGSTASH EVENT HERE>}
}
}
}
My logstash conf looks like
elasticsearch {
index => 'percolator'
query_template => 'query_template.json' # The template above
}
And the sprintf code in the filter I'm referring to is below. The query_dsl variable contains the content of the query_template.json file.
if @query_dsl
query = LogStash::Json.load(event.sprintf(@query_dsl))
params[:body] = query
...
Many thanks,
Nick George