Ruby Filter: Getting more info for logstash.filters.ruby errors

The Logstash 5.6.7 logging pipeline in use has about 50 conditionals inside the filter, most of them resulting in data manipulations through Ruby codes in a form

if <something> {
   ruby {
      code => ”
         <ruby_code_here>
      "
   }
}

That works just fine but every now and then Logstash fails and it logs a cryptic message

10:00:19.809 [[main]>worker1] ERROR logstash.filters.ruby - Ruby exception occurred: can't convert String into Integer

The trouble is that none of the Ruby fragments implicitly performs a .to_i operation and the source message is not logged. log4j2.properties file contains

log4j.appender.console.type=Console
log4j.appender.console.layout=net.logstash.log4j.JSONEventLayoutV1
log4j.rootLogger=INFO, console

Increasing rootLogger INFO -> DEBUG just jams whole logging pipeline.

Is it possible to get more information where Logstash was applying the Ruby filter and what was the source message? Thanks a lot!

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