Skip to content

Instantly share code, notes, and snippets.

View bryankouwen's full-sized avatar

Bryan Kouwen bryankouwen

View GitHub Profile
@cjlyons81
cjlyons81 / json-to-event.rb
Last active December 6, 2019 15:17
Ruby filter for parsing json and adding to event in a Logstash pipeline
# ruby {
# path => "/etc/logstash/ancillary/ruby-scripts/json-to-event.rb" <--Example path to ruby file, be sure to update with yours
# script_params => {
# "json_field" => "notes" <--Specify the field you want to extract json from (default: message)
# "array" => true <--Do you want to flatten arrays within the json (default: false)
# "target" => "parent" <--Specify root level name if wanted (default: root of document)
# "tag_match_failure" => true <--Do you want to tag event when json regex match fails (defaults: false)
# }
# }