Hi,
we are getting ruby exception error in logstash as shown in below.
[ERROR][logstash.filters.ruby ][xxxxxxxxxx][634d732ae35f96b2b7a40d6e0005815a22897257fd1aa2279fe1d02125a79ba0] Ruby exception occurred: undefined method each' for nil:NilClass {:class=>"NoMethodError", :backtrace=>["(ruby filter code):3:in
block in filter_method'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-filter-ruby-3.1.7/lib/logstash/filters/ruby.rb:93:in inline_script'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-filter-ruby-3.1.7/lib/logstash/filters/ruby.rb:86:in
filter'", "/usr/share/logstash/logstash-core/lib/logstash/filters/base.rb:159:in do_filter'", "/usr/share/logstash/logstash-core/lib/logstash/filters/base.rb:178:in
block in multi_filter'", "org/jruby/RubyArray.java:1821:in each'", "/usr/share/logstash/logstash-core/lib/logstash/filters/base.rb:175:in
multi_filter'", "org/logstash/config/ir/compiler/AbstractFilterDelegatorExt.java:134:in multi_filter'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:299:in
block in start_workers'"]}
the ruby part is
if([abc])
{
ruby {
code => "
event.get('[abc][Steps]').each do |item|
event.set('[abc][step'+item['stepid'].to_s+']',item)
end
"
}
}