Is this in a script file? If so, event is in scope because it is passed to filter(event). If you want it to be in scope in other methods you need to pass it to them.
OK. event is a local variable in-scope within the code block you pass to the filter. However, it is out of scope for functions defined within that block. This will get you an undefined local error.
code => '
def foo
event.tag("CATCH")
end
foo
'
You have to pass event to the function.
code => '
def foo(e)
e.tag("CATCH")
end
foo event
'
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.