HI,
I am aggragating events for each session from log
I fetch the log time from event
in aggregate filter, i want to have a field startdatetime and assign session open time to this,
set timeout_timestamp_field => "StartDateTime",
Then assign this "StartDateTime" to @timestamp
first part works fine but i get date parse error . What am i missing ?
Snippet from Filter plugin
mutate {
add_field => {
"StartDateTime" => "%{log_time}"
}
}
date {
match => [ "log_time" , "MMM dd HH:mm:ss" ]
timezone => "EST5EDT"
target => "log_time"
}
date {
match => [ "StartDateTime" , "MMM dd HH:mm:ss" ]
timezone => "EST5EDT"
target => "StartDateTime"
}
if ([msg] =~ /^session opened /) {
aggregate {
task_id => "%{sessionId}"
code => "
map['StartDateTime'] = event.get('log_time')
event.cancel()"
map_action => "create"
}
}
more aggregate filters
if ([msg] =~ /^session closed /) {
aggregate {
task_id => "%{sessionId}"
code => "
event.set('StartDateTime', map['StartDateTime'])"
map_action => "update"
end_of_task => true
timeout => 6
timeout_timestamp_field => "StartDateTime"
timeout_task_id_field => "sessionId"
push_map_as_event_on_timeout => true
}
}