Hi All,
i'm trying to calculate the time difference between 2 dates. I'm capturing the data through jdbc
Input
"opentime" : "2020-11-01T11:42:59.000Z",
"resolvedtime" : "2020-11-02T22:38:37.000Z",
Code
filter {
date {
match => ["opentime", "ISO8601"]
}
date {
match => ["resolvedtime", "ISO8601"]
}
ruby {
init => "require 'time'"
code => "duration = (event.get('resolvedtime') - event.get('opentime')) rescue nil; event.set('Time_duration', duration); "
}
}
Output
Time_duration: null
Thanks in Advance