I have some JSON data coming to me over HTTP. Each record has a field that needs to be converted to an integer but its name will vary, e.g. "fieldA_count" in one record and "fieldfB_count" in another. Each record contains another identifying field named "field_name" with a value "fieldA" or "fieldB". I want to use the identifying field to name the field I need to convert to an integer, i.e.
mutate{
convert => { "%{field_name}_count => "integer" }
}
I'd like this evaluated to:
mutate{
convert => { "fieldA_count => "integer" }
}
...or:
mutate{
convert => { "fieldB_count => "integer" }
}
But when I tried this the fields remained Strings. What am I doing wrong?
Craig