Hi team,
I am using logstash filter to get the duration between two dates.
StartDate =2023-05-23T 10:25:53.123Z
EndDate =2023-05-23T 18:25:43.123Z
using the code below:--
match => [ "Start Date", "ISO8601" ]
target => "start_date"
}
date {
match => [ "End Date", "ISO8601" ]
target => "end_date"
}
ruby {
init => "require 'time' "
Code=> "event.set('duration', event.get('end_date').to_f - event.get('start_date').to_f )
"
}
In one machine it's showing proper output in second as (ex-34526.234) but in another machine for same code it's showing (1243678889.788) 10 digit output .
Is it the issue of time in Date filter?
Or any other issue?
Any help would be thankful.