logstash-filter-mutate
logstash-filter-mutate copied to clipboard
Omitempty
Add an operation called 'omitempty' to remove fields with null or default values. (works with string "", integer 0, array [], hashes {}, and null values)
filter {
mutate {
omitempty => ["field"]
}
}
will remove field if field = "", 0, [], {} or null
useful with the logstash-codec-protobuf to remove fields present in the proto definition that have no values, aka "omitempty"in the JSON marshaller options
(new to ruby and logstash filters dev, so please fell free to point any bad or misplaced statement, thanks)