I'm trying to initialize a variable in a ruby filter. It works properly with the code tag, but not when using a ruby file.
Here is my code:
pipeline.conf
ruby {
init => "@val = 5 "
path => "script.rb"
}
script.rb
def register(params)
end
def filter(event)
puts @val
return [event]
end
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.