I have around 40 fields of numeric data in csv format and occasionally multiple fields in a row could be invalid values (indicated with, say, hyphen -).
In the logstash is there a way to define a single generic mutate rule that works on all the fields to convert the hyphen (-) into numeric zero (0).
Right now, I have to have mutate rule once for each field, which is not really good way. For example,
csv { columns => [ col1, col2, col3, .... col40 ] }
mutate {
gsub => [
"col1", "-", 0,
"col2", "- ", 0,
....
]
}
}
Is there a much better simpler way to achieve this than to manually specify the same rule 40 times?