Currency and Gross_Value are existing fields:
mutate {
add_field => {"Gross_Euro" => "" }}
mutate {
convert => { "Gross_Euro" => "float" }}
if "INR" in [Currency] {
ruby { code => "event ['Gross_Euro'] = event['Gross_Value'] * 0,01221"} }
With above I get a [0] "_rubyexception"
[2019-01-21T12:07:30,690][ERROR][logstash.filters.ruby ] Ruby exception occurred: Direct event field references (i.e. event['field']) have been disabled in favor of using event get and set methods (e.g. event.get('field')). Please consult the Logstash 5.0 breaking changes documentation for more details.
Ahh ok try this:
if "INR" in [Currency] {
ruby {
"event.set ('[Gross_Euro]' = event.get('[Gross_Value]' * 0,01221))"
}
}
and this:
if "INR" in [Currency] {
ruby {
"event.set ('[Gross_Euro]' = event.get('[Gross_Value]') * 0,01221)"
}
}
and this:
if "INR" in [Currency] {
ruby {
"event.set ('[Gross_Euro]') = event.get('[Gross_Value]') * 0,01221"
}
}
nope !
I now something is wrong but dunno what exactly.
Thanks for any hint
Regards