Logstash - GELF输出错误

时间:2016-10-28 13:28:59

标签: logstash graylog2

我已将Graylog v2.1.1安装为Windows 7 PC上的VirtualBox内的虚拟设备。

我正在尝试阅读一个简单的日志文件,并使用logstash v5.0.0使用logstash-output-gelf-3.1.1插件将其转发到Graylog,如下所述:https://stackoverflow.com/a/31054064/4863804

我已设置以下logstash.conf输出:

input { 
  file {...}
}

output {
  gelf {
    host => "199.99.99.179"
    port => 12203
  }
}

但在运行logstash -f logstash.conf后,我收到以下错误:

[2016-10-28T14:52:17,756][INFO ][logstash.pipeline        ] Pipeline main started
[2016-10-28T14:52:17,817][INFO ][logstash.agent           ] Successfully started Logstash API endpoint {:port=>9600}
[2016-10-28T14:52:18,594][FATAL][logstash.runner          ] An unexpected error occurred! {:error=>#<NameError: no method 'debug' for arguments (org.jruby.RubyArray,org.jruby.RubyHash) on Java::OrgApacheLoggingLog4jCore::Logger
  available overloads:
    (org.apache.logging.log4j.Marker,java.lang.String,java.lang.Object[])
    (org.apache.logging.log4j.Marker,java.lang.String,org.apache.logging.log4j.util.Supplier[])
    (java.lang.String,org.apache.logging.log4j.util.Supplier[])
    (java.lang.String,java.lang.Object[])>, :backtrace=>["C:/SDKs/logstash-5.0.0/logstash-core/lib/logstash/logging/logger.rb:41:in `debug'", "C:/SDKs/logstash-5.0.0/vendor/bundle/jruby/1.9/gems/logstash-output-gelf-3.1.1/lib/logstash/outputs/gelf.rb
:190:in `receive'", "C:/SDKs/logstash-5.0.0/logstash-core/lib/logstash/outputs/base.rb:92:in `multi_receive'", "org/jruby/RubyArray.java:1613:in `each'", "C:/SDKs/logstash-5.0.0/logstash-core/lib/logstash/outputs/base.rb:92:in `multi_receive'", "C:/S
DKs/logstash-5.0.0/logstash-core/lib/logstash/output_delegator_strategies/legacy.rb:19:in `multi_receive'", "C:/SDKs/logstash-5.0.0/logstash-core/lib/logstash/output_delegator.rb:42:in `multi_receive'", "C:/SDKs/logstash-5.0.0/logstash-core/lib/logst
ash/pipeline.rb:297:in `output_batch'", "org/jruby/RubyHash.java:1342:in `each'", "C:/SDKs/logstash-5.0.0/logstash-core/lib/logstash/pipeline.rb:296:in `output_batch'", "C:/SDKs/logstash-5.0.0/logstash-core/lib/logstash/pipeline.rb:252:in `worker_loo
p'", "C:/SDKs/logstash-5.0.0/logstash-core/lib/logstash/pipeline.rb:225:in `start_workers'"]}

1 个答案:

答案 0 :(得分:0)

更新

这似乎是由logstashlogstash-output-gelf之间的版本不匹配引起的,因为相同的配置可以与logstash-2.4.0一起使用。 也许输出插件需要更新为5.0.0。