Skip to content

Omitempty#132

Open
gferreux wants to merge 7 commits intologstash-plugins:mainfrom
gferreux:omitempty
Open

Omitempty#132
gferreux wants to merge 7 commits intologstash-plugins:mainfrom
gferreux:omitempty

Conversation

@gferreux
Copy link
Copy Markdown

@gferreux gferreux commented Mar 5, 2019

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants