Logstash-Output-Mongodb to Mongo 3.4

I am attempting to use the MongoDB Logstash Output plugin to output some data to the online MongoDB 3.4 (Atlas). Every time Logstash tries to send the data to the MongoDB I receive the following error:

[2017-11-24T22:24:55,885][WARN ][logstash.outputs.mongodb ] Failed to send event to MongoDB {:event=>#LogStash::Event:0x2141406e, :exception=>#<Mongo::Error::NoServerAvailable: No server is available matching preference: #<Mongo::ServerSelector::Primary:0xbc3fb62 @tag_sets=[], @server_selection_timeout=30, @options={:database=>"test", :ssl=>true, :replica_set=>"staging-shard-0", :auth=>{:source=>"admin"}, :user=>"user", :password=>"password"}>>, :backtrace=>["/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/mongo-2.0.6/lib/mongo/server_selector/selectable.rb:99:in select_server'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/mongo-2.0.6/lib/mongo/cluster.rb:122:innext_primary'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/mongo-2.0.6/lib/mongo/collection.rb:196:in insert_many'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/mongo-2.0.6/lib/mongo/collection.rb:175:ininsert_one'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-mongodb-3.1.3/lib/logstash/outputs/mongodb.rb:100:in receive'", "/usr/share/logstash/logstash-core/lib/logstash/outputs/base.rb:92:inblock in multi_receive'", "org/jruby/RubyArray.java:1734:in each'", "/usr/share/logstash/logstash-core/lib/logstash/outputs/base.rb:92:inmulti_receive'", "/usr/share/logstash/logstash-core/lib/logstash/output_delegator_strategies/legacy.rb:22:in multi_receive'", "/usr/share/logstash/logstash-core/lib/logstash/output_delegator.rb:49:inmulti_receive'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:538:in block in output_batch'", "org/jruby/RubyHash.java:1343:ineach'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:536:in output_batch'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:481:inworker_loop'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:439:in `block in start_workers'"]}

After doing some research it appears to be the MongoDB driver that is associated with the plugin. It is currently using 2.0.x and according to MongoDB's documentation the driver needs to be 2.4. I was wondering if anyone could assist in figuring how to connect Logstash to MongoDB as I am new to MongoDB. Below is the versions of software that I am working with.

Version of Software
MongoDB: 3.4
Logstash: 6.0
Plugin: 3.1.3

Thank you in advance.

1 Like

I have the same problem. Jonathan, did you mange to solve it?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.