Hello there,
I must be doing it wrong
aggregate {
task_id => "%{clientip}"
code => "map['timestamp'] ||= event.get['@timestamp'].to_i"
push_map_as_event_on_timeout => true
timeout_task_id_field => "clientip"
timeout => 14400
inactivity_timeout => 600
timeout_tags => ['_aggregatetimeout']
timeout_code => "event.set('session_duration', map['timestamp'] - event.get['@timestamp'].to_i)"
}
Throws me a:
[ERROR][logstash.filters.aggregate] Aggregate exception occurred {:error=>#<ArgumentError: wrong number of arguments calling `get` (0 for 1)>, :code=>"map['timestamp'] ||= event.get['@timestamp'].to_i", :map=>{}
Can't find out what's wrong. The idea being to catch the timestamp from first event and compute difference with last event.
BTW, Logstash 5.5.0
Thanks for any help!