我遇到了logstash的ruby过滤器问题。
这是我在logstash.conf中的ruby代码:
const variable = {};
export default variable;
运行我的配置时出现此错误:
filterworker中的异常{“exception”=> #register'“,”org / jruby / RubyProc.java:271:在`call'“中, “/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-filter-ruby-0.1.5/lib/logstash/filters/ruby.rb:37:in`filter'”, “/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.0-java/lib/logstash/filters/base.rb:162:in
input { stdin { codec => json } } filter { json { source => "message" } ruby { code => " result = ''; msg = event['payload']['check']['output']; result = msg.split(/\n/); event['check_output'] = result; " } } output { elasticsearch { host => "host" port => "port" } }
start_filters'“],:level =>:error}
但是使用上面的代码,我使用了stdout {}输出或文件输出,它可以正常工作
所以,我需要一些帮助来找出这个问题,我不确定它是关于ruby问题还是logstash问题。感谢