I cannot mutate >> convert multiple fields

Hi,

I am trying to convert few of my fields to integer using logstash 1.5. When converting just one field it works fine doing this to convert my field "failed" to integer:

   mutate {
               convert => [ "failed", "integer" ]
         }

But I have read in the documentation that it's possible to use an array of fields to convert multiple fields to integer. I have tried in many different combinations and I cannot manage to convert many fields providing an array of fields. I have tried this syntax and also different variations without luck

mutate {
     convert => {
            [ "failed", "exit_status" ] => "integer",
          }
        }


mutate {
               convert => [ "exit_status", "failed" ], "integer"
         }

   mutate {
               convert => [ "exit_status", "failed" ] => "integer"
         }

could anyone provide a working example to convert an array of fields using logstash-1.5? Right now the only workaround I found is to define a new convert entry by field to convert...

1 Like

I found the working syntax thanks to @qchris in the #logstash irc channel:

mutate {
         convert => {
                  "failed" => "integer"
                  "exit_status" => "integer"
         }
}
2 Likes

Thanks!

Thanks!!!

Thank