Loading...

Replace NaN values with zero

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 }
    }
}