Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Use ruby object in logstash ruby filter
input {
stdin {}
}
filter {
ruby {
init => "load('ruby.rb'); @val=Myclasse.new('value')"
code => "event['method']=@val.value()"
}
}
output {
# Debug sur la sortie standart
stdout { codec => rubydebug }
}
class Myclasse
attr_reader :value
attr_writer :value
def initialize(value)
@value = value
end
end
/opt/logstash/bin/logstash -f logstash.conf
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.