Hi ,
i have been attempting to create an additional field into my logging which keeps the responsetime of tsa requests to a service .
after looking though some stuff i found that it looked like it would be possible with an aggregate filter in logstash so i tried to implement it but i keep getting errors about the formatting of the filter clause
below is the filter part of the pipeline im creating
the idea behind it is to subtract the 2 timestamps between the request received and request finnished logs
any help on this topic or any other way to achieve the result with elastic stack would be greatly appreciated
filter {
if [message] =~ "RECEIVED TSA REQUEST" {
aggregate {
task_id => "test"
code => "map['timestamp'] = %{@timestamp}
map_action => "create"
}
}
if [message] =~ "FINISHED TSA REQUEST" {
aggregate {
task_id => "test"
code => "event.set(map['timestamp'] - '@timestamp')"
map_action => "update"
end_of_task => true
timeout => 120
}
}
}