Hi all,
I am trying to use/offload some Ruby code in a filter to process XML events (due to various reasons, I have to move away from the XML input plugin).
The problem is, that the import of 'nori' class fails within logstash/ruby, while the code etc. works fine in irb. When testing/running the grok, logstash throws an error that it could not load the 'nori' class (while other classes as for example 'nokigiri' can be imported)
logstash -f /etc/logstash/conf.d/111-filter-xml.conf -t
...
[ERROR] 2020-10-07 13:45:15.721 [LogStash::Runner] Logstash - java.lang.IllegalStateException: Logstash stopped processing because of an error: (LoadError) no such file to load -- nori
where I am just using the ruby plugin pointing to the scriptlet
filter {
if "xml" in [tags] {
ruby {
path => "/etc/logstash/ruby.d/myxmlruby.rb"
}
}
}
where I can trigger the error from the scriptlet by just requiering nori
require 'nokogiri'
require "nori"
def register(params)
end
def filter(event)
return [event]
end
I have already tried to install/uninstall the nori package from various sources (yum/rpm & gem).
Do I maybe have to setup the logstash ruby environment in some specific way to pick up the additional classes somehow?
Cheers and thanks for ideas,
Thomas