Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
filter {
ruby {
path => "${PWD}/processor-hostname.logstash-filter-ruby.rb"
script_params => {
"target" => "@processed-by"
}
}
}
def register(params)
params = params.dup
@target = params.delete('target') || fail(LogStash::ConfigurationError.new('`target` parameter is required'))
@hostname = Socket.get_hostname.dup.freeze
end
def filter(event)
event.set(@target, @hostname)
ensure
return [event]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.