I need to parse some incoming messages where for network reasons, one event as seen by Logstash is really a concatenation of multiple events. To do that I'm trying to use the ruby plugin, breaking the initial message into pieces, with the idea, at least, of passing those on to the remainder of the pipeline. The syntax is more complicated than the split filter plug-in can handle, but the goal is essentially the same.
The documentation for the ruby plugin (3.1.5 -- the version I am using) says I need to use new_event_block.call(newevent) to create events, however in Logstash 7.6.1, at least, this generates an error:
Could not process event: undefined local variable or method `new_event_block' for #<LogStash::Filters::Ruby::Script::ExecutionContext:0x47f06865>
As an alternative, I tried creating an array containing the events and just returning that, but what happens in practice is that the array just grows and grows, and is never passed to the rest of the pipeline.
What's the best way to do this? Is the documentation simply wrong, or is some additional undocumented setup needed before I can use new_event_block?