It seems I'm also not putting the method in the right place, and I can't find an example in the documentation.
My current code looks like this
ruby {
code => "
def testcasebuilder()
for i in 0..5
event.set('new_field', event.get('new_field') + ['test'])
end
end
begin
event.set('new_field', ['test'])
testcasebuilder()
end"
}
I've also tried this
ruby {
code => "
begin
def testcasebuilder()
for i in 0..5
event.set('new_field', event.get('new_field') + ['test'])
end
end
event.set('new_field', ['test'])
testcasebuilder()
end"
}
Neither of these work. Where should I put my method so that I can call it?
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.