Logstash ruby filter in separate script throws : undefined local variable or method `new_event_block' for #<LogStash::Filt ers::Ruby::Script::ExecutionContext


I am migrating my inline ruby script to an external ruby script file.

First I create an new event with : service_trace_event = LogStash::Event.new
After filling the fields like : service_trace_event.set("id",result_set.getString(1).to_i) ,
I do the following call: new_event_block.call(service_trace_event)

But then I get the following error:
undefined local variable or method `new_event_block' for #<LogStash::Filt

What am I doing wrong?

Regards Hans

If you want to create new events in an external ruby script file you can use LogStash::Event.new, but then just put them in an array and return them from the script's filter function.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.