aggregate{
task_id => "%{Response}"
code =>"
if(event.get(Response) == "answered")
map['answers'] ||= 0;
map['answers'] += 1;
end
"
push_map_as_event_on_timeout => true
timeout_task_id_field => "callMessage"
timeout => 60
timeout_tags => ['_aggregatetimeout']
timeout_code => "event.set('several_incomings', event.get('answers') > 1)"
}
When I use this in my logstash configuration file, I get this error message:
[ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of #, {, }
I don't understand what's wrong. When I remove the if statement, it works, but I only want to count the "answered" calls.