Skip to content

Instantly share code, notes, and snippets.

@91pavan
Last active February 15, 2016 10:03
Show Gist options
  • Save 91pavan/f38eac2286efcfe5f739 to your computer and use it in GitHub Desktop.
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
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