Hello Lords of Logstash,
In my data, I need to add a new field that multiplies the integer values of two other fields and a constant. In other words, if I have this:
FieldA FieldB
================
1 5
2 4
3 9
And I want to do this in my filter{ } section:
mutate {
add_field => { "[FieldC]" => "%{[FieldA]} * %{[FieldB]} * 5" }
convert => { “FieldC” => “integer” }
}
To get this:
FieldA FieldB FieldC
==========================
1 5 25
2 4 40
3 9 135
But the above mutate{} statement treats FieldC as a string and gives me this:
FieldA FieldB FieldC
===============================
1 5 “1 * 5 * 5”
2 4 “2 * 4 * 5”
3 9 “3 * 9 * 5”
Which is obviously not what I want. And if I remove the double quotes in my add_field statement, Logstash promptly crashes.
Any idea how to fix this syntax? Thanks!