Replace NaN values with zero

:heavy_exclamation_mark: This post is older than a year. Consider some information might not be accurate anymore. :heavy_exclamation_mark:

In logstash some grokked fields in messages, that suppose to be numeric, flying in with “NaN” (Not a Number). You can convert them with the mutate filter plugin.

if [value] == "NaN" {
    mutate {
        replace => { "value" => 0 }