This is my code
First I am changing them to integer
then if they are nil assign them 0
and then do calculation.
mutate {
convert => { "killo" => "integer" }
convert => { "trace" => "integer" }
}
if ![killo] {
mutate {update => { "kilo" => 0 } }
}
if ![trace] {
mutate {update => { "trace" => 0 } }
}
ruby {
code => "event.set('total',(event.get('kilo')*event.get('trace')))"
}
and I get this error
"ruby - Ruby exception occurred: no implicit conversion of String into Integer"
What I am doing wrong?