Hello,
I try to do a substraction on a float number and i'm facing this issue:
# echo '{"ts":"123124.094", "rq":"0.020"}' | \
/opt/logstash/bin/logstash -e \
"input {
stdin { codec => json }
} output {
stdout { codec => rubydebug }
} filter {
ruby { code => \"event.set('total', event.get('ts') - event.get('rq'))\" }
}"
Settings: Default pipeline workers: 4
Pipeline main started
Ruby exception occurred: undefined method `get' for #<LogStash::Event:0x60e932d7> {:level=>:error}
{
"ts" => "123124.094",
"rq" => "0.020",
"@version" => "1",
"@timestamp" => "2017-12-15T17:00:31.650Z",
"host" => "es-traces.novalocal",
"tags" => [
[0] "_rubyexception"
]
}
Pipeline main has been shutdown
stopping pipeline {:id=>"main"}
I could not find the event.(get|set) description in the logstash 2.3 documentation, so maybe it is not handled in this version.
Upgrading logstash is not an option for me unfortunately.
Can you share how to achieve that kind of substraction?
Thank you