Hello,we now want to do Arithmetic in logstash ruby code.
The ruby code is:
ruby {
init => "@@count = -1"
code => "
event.set('[test]', @@count)
event.set('[test2]', event.get('[layers][frame_time_relative]').to_f / 0.3)
@@count = event.get('[layers][frame_time_relative]')
"
}
The frame_time_relative is a float type number.
We find the "test2" event code function can not work.
Data in kibana only show "test1".
We set the test2 elasticsearch module as:"test2":{"type":"long","fields": {"keyword": {"ignore_above": 256,"type": "keyword"}}}
We try this module setting or use default setting the result is same.
Is there any wrong coding?