Last active
February 15, 2016 10:03
-
-
Save 91pavan/f38eac2286efcfe5f739 to your computer and use it in GitHub Desktop.
Logstash filter configuration to read all incoming fields and make them available for consumption
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 => " | |
require 'json' | |
if event['type'] == 'syslog' | |
eventJson = event.to_hash | |
if eventJson.has_key?('@version') | |
eventJson.delete('@version') | |
end | |
if eventJson.has_key?('type') | |
eventJson.delete('type') | |
end | |
event['message'] = eventJson.to_json.gsub!(/\"/, '\'') | |
end | |
" | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment