Mutating several fields at once

Hi Guys,

I'm looking for a more efficient way to convert my fields. My output looks like this:

"id" => 1.0
"code" => 200.0
"name" =>  "Something     "
"middlename" => "      Hok"
"lastname" =>  "Something as well"

I need to convert my numeric values to integers and strip all whitespaces from string fields.
Normally I would use simple operations:

mutate {
convert => {
"id" => "integer"
"code" => "integer"
strip => ["name", "middlename", "lastname"]

And that's ok for a few fields. But let's assume i have around 100 of each type and doing the same for all of them might be problematic. Is there a more efficient way to do it? Ruby, conditional statement? If so, what would be the code to achieve it?
Thanks in advance!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.