logstash-out-mongodb 设置generateId老是报异常,求指导

发布于 2021-12-02 17:15:51 字数 2812 浏览 950 评论 1

大神们好,遇到非常痛苦的问题。现在用logstash-out-mongodb插件,设置generateId=>true,为是报异常。请求帮忙解决下。谢谢。

配置文件:

input {
    stdin{}
}


output{


       mongodb {
        collection => "std"
        database => "fragment"
        generateId => true
        uri => "mongodb://192.168.199.7:27017"
       }
}



异常:

Failed to send event to MongoDB {:event=>#<LogStash::Event:0x2ef73b32 @metadata={}, @accessors=#<LogStash::Util::Accessors:0x694f67b4 @store={"message"=>"hello", "@version"=>"1", "@timestamp"=>"2016-09-02T05:33:49.575Z", "host"=>"mini03"}, @lut={"host"=>[{"message"=>"hello", "@version"=>"1", "@timestamp"=>"2016-09-02T05:33:49.575Z", "host"=>"mini03"}, "host"], "@timestamp"=>[{"message"=>"hello", "@version"=>"1", "@timestamp"=>"2016-09-02T05:33:49.575Z", "host"=>"mini03"}, "@timestamp"]}>, @data={"message"=>"hello", "@version"=>"1", "@timestamp"=>"2016-09-02T05:33:49.575Z", "host"=>"mini03"}, @metadata_accessors=#<LogStash::Util::Accessors:0x1f036be0 @store={}, @lut={}>, @cancelled=false>, :exception=>#<ArgumentError: wrong number of arguments calling `initialize` (2 for 0)>, :backtrace=>["/export/servers/logstash-2.4.0/vendor/bundle/jruby/1.9/gems/logstash-output-mongodb-2.0.5/lib/logstash/outputs/mongodb.rb:54:in `receive'", "/export/servers/logstash-2.4.0/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/outputs/base.rb:109:in `multi_receive'", "org/jruby/RubyArray.java:1613:in `each'", "/export/servers/logstash-2.4.0/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/outputs/base.rb:109:in `multi_receive'", "/export/servers/logstash-2.4.0/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/output_delegator.rb:130:in `worker_multi_receive'", "/export/servers/logstash-2.4.0/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/output_delegator.rb:114:in `multi_receive'", "/export/servers/logstash-2.4.0/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:301:in `output_batch'", "org/jruby/RubyHash.java:1342:in `each'", "/export/servers/logstash-2.4.0/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:301:in `output_batch'", "/export/servers/logstash-2.4.0/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:232:in `worker_loop'", "/export/servers/logstash-2.4.0/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:201:in `start_workers'"], :level=>:warn}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不再见 2021-12-03 20:16:26

设置generateId就报这个异常,请求怎么处理。

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文