Logstash-output-mongodb Error::NoServerAvailable:


(Irom77) #1

Getting Error::NoServerAvailable: , my output is pretty simple and mono uri verified, please advise

    output {
       if [type] == "threat" {
          # Use mongodb to store logstash event.
          mongodb {
             database => "meteor"
             uri => "mongodb://mongo:27017/meteor"
             collection => "syslog" 
          }
       }
}

See full logstash log below:

16:37:57.295 [[main]>worker1] WARN logstash.outputs.mongodb - Failed to send event to MongoDB {:event=>2017-08-17T16:34:09.213Z 10.34.1.100 <141>August 17 16:34:09 dc01ap-p001mon 1,2017/17/08 16:34:09,001901000999,threat,file,1,2017/17/08 16:34:10,1.1.1.1,2.2.2.2,0.0.0.0,0.0.0.0,G0s9J4jAU3,me,you,App test,vsys1,src,dst,ae1.100,ae2.200,LF-elk,2017/17/08 16:34:11,33891243,1,11111,22222,0,0,0x0,tcp,test,Test,This is test only,any,low,server-to-client,5210010,0x0,10.10.10.0-10.255.255.255,10.20.20.20-10.255.255.255,0,,,,,,,,,,,,,, :exception=>#<Mongo::Error::NoServerAvailable: No server is available matching preference: #<Mongo::ServerSelector::Primary:0x1fd3f16b @tag_sets=[], @options={:database=>"meteor"}, @server_selection_timeout=30>>, :backtrace=>["/usr/share/logstash/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/server_selector/selectable.rb:99:in select_server'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/cluster.rb:122:innext_primary'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/collection.rb:190:in insert_many'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/mongo-2.0.6/lib/mongo/collection.rb:175:ininsert_one'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-mongodb-3.1.2/lib/logstash/outputs/mongodb.rb:100:in receive'", "/usr/share/logstash/logstash-core/lib/logstash/outputs/base.rb:92:inmulti_receive'", "org/jruby/RubyArray.java:1613: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:47:inmulti_receive'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:420:in output_batch'", "org/jruby/RubyHash.java:1342:ineach'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:419:in output_batch'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:365:inworker_loop'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:330:in `start_workers'"]}


(Arun Prakash) #2

Hi All,

I am also facing the same issue. Can any one help me out to overcome this issue.

Thanks in advance,

Arun.


(system) #3

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