Last active
April 28, 2017 08:10
-
-
Save devlatte/051f435b885e59102a559e6662bf17e2 to your computer and use it in GitHub Desktop.
logstash rename json empty key field using ruby filter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filter{ | |
ruby { | |
code => "h = event.get('[record][param]').to_hash; if h.has_key?('') then h['_LS_EMPTY_KEY']=h['']; h.delete(''); event.set('[record][param]', h) end" | |
} | |
} | |
# rename empty key field using ruby filter | |
# solution for error msg "name cannot be empty string" in elasticsearch output plugin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment