I'm trying to do simple math calculations, e.g. convert a number to a decimal such as 93 => 0.93.
I've looked around and can't find the proper syntax to do this. Furthermore, I don't get any warnings in the logs, just see Logstash continuously restart (even with logging set to DEBUG).
My code:
if [utilization_perc_int] {
ruby {
code => 'event.set("utilization_percent") = event.get("utilization_perc_int"} / 100'
}
}
Can anyone tell me what's wrong with my code syntax here? More importantly, can anyone tell me where to find what Ruby code (and supporting syntactical examples if possible) is supported in Logstash? The docs are pretty thin regarding the 'code' functionality within the Ruby filter.