Logstash 5 Alpha4到elasticsearch5 Alpha4通信错误

时间:2016-07-22 09:42:28

标签: elasticsearch logstash

Elasticsearch 5使用xpack安全保护,并与ldap挂钩,工作正常。即使用户在role_mapping中拥有管理员权限。

Logstash 5配置如下

output {
  elasticsearch {
    hosts => ['localhost:9200']
    user => 'gaurav@gmail.com'
    password => 'pwd'
  }
}

获得以下错误,因为logstash无法将数据传递给elasticsearch。

{:timestamp=>"2016-07-14T16:32:29.592000+0530", 
:message=>"Encountered an unexpected error submitting a bulk request! Will retry.", 
:error_message=>"undefined method code' for #", 
:class=>"NoMethodError", :backtrace=>["/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-4.1.1-java/lib/logstash/outputs/elasticsearch/common.rb:217:insafe_bulk'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-4.1.1-java/lib/logstash/outputs/elasticsearch/common.rb:105:in submit'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-4.1.1-java/lib/logstash/outputs/elasticsearch/common.rb:72:inretrying_submit'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-4.1.1-java/lib/logstash/outputs/elasticsearch/common.rb:23:in multi_receive'", "org/jruby/RubyArray.java:1653:ineach_slice'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-4.1.1-java/lib/logstash/outputs/elasticsearch/common.rb:22:in multi_receive'", "/usr/share/logstash/logstash-core/lib/logstash/output_delegator.rb:136:inthreadsafe_multi_receive'", "/usr/share/logstash/logstash-core/lib/logstash/output_

1 个答案:

答案 0 :(得分:1)

我想我可能已经弄明白了。我正在使用Logstash 5.1.1-alpine docker图像。据我所知,它附带了elasticsearch-output插件v4.5.0,它似乎有这个bug。强制将该插件更新到最新版本(6.2)已解决此问题。

我的Dockerfile现在

FROM logstash:5.1.1-alpine

RUN $LOGSTASH_PATH/logstash-plugin install --version 6.2.0 logstash-output-elasticsearch

使用更新的插件,我不再看到此错误。