Logstash can not use path option in ruby

I try to use ruby script file in my lostash conf file(filter).
but it failed, the error logs:
[2018-01-26T21:12:49,988][ERROR][logstash.filters.ruby ] Unknown setting 'path' for ruby
[2018-01-26T21:12:49,998][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Something is wrong with your configuration.", :backtrace=>["/home/tool/elk/logstash-6.0.0/logstash-core/lib/logstash/config/mixin.rb:114:in `config_init'", "/home/tool/elk/logstash- ....

my filter code as:
filter{
grok{ match=>{ "message"=>"%{MMETIME:LogDate} - %{MMECASENAME:CaseName} - %{WORD:MMEName} - %{UNITNAME:UnitName} - %{MMEMESSAGETYPE:MessageType} - %{MMEMESSAGENAME:MessageName}:%{NUMBER:Count}"}}
ruby{
path => "/home/tool/elk/logstash-6.0.0/mmeconf/causeMap.rb"
}
}

Seems like you for some reason have an old version of the ruby plugin. You can use the logstash-plugin command to check the version of the plugin as well as upgrade it.

I have tired to update the plugin logstash-filter-ruby, but it said:
No plugin updated.
my ruby version is:
[root@master bin]# ./ruby -v
jruby 9.1.13.0 (2.3.3) 2017-09-06 8e1c115 Java HotSpot(TM) 64-Bit Server VM 25.152-b16 on 1.8.0_152-b16 +indy +jit [linux-x86_64]

Never mind what version of Ruby you have. What version of the logstash-filter-ruby plugin do you have? Use logstash-plugin list --verbose.

It's shows logstash-filter-ruby (3.1.3). does this OK?

Yes, with that version the path option should work. How did you install Logstash? Have you tried deleting all traces of the installation and installing it again? It looks like you might have old files laying around.

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