Hello,
I'm trying to subtract two dates ISO 8601 type, to extract an XML plugin through the ruby. The goal is to get the difference in the form of an integer with which to operate later.
I am using the latest version of logstash, 2.2.2.
I tried several examples, but without success. This is the example that I think is the one that should work.
Example:
ruby {code => "event['time_difference'] = Time.parse(DateTime.Parse('t_fin_etapa01')).to_i - Time.parse(DateTime.Parse('t_inicio_etapa01')).to_i"}
Result:
? [31mRuby exception occurred: undefined method `gsub '! for # <DateTime: 0x441d4c76> {: level =>: error} ? [0m
Any idea what I'm doing wrong?
Thanks in advance,
Regards!