I was trying to use ruby filter to calculate time difference:
ruby{
code => "require 'date';
event.set('landing_delay',((
DateTime.parse(event.get('landing_t')) -
DateTime.parse(event.get('t'))
) * 24 * 60 * 60
).to_i
)"
}
But sometimes it works, sometimes it returns error:
[ERROR][logstash.filters.ruby ] Ruby exception occurred:
with no detailed information.
I'm using logstash 6.4.2 on docker, anyone can help? Many thanks!