I am using logstash v7.9.0 for Windows. I am using logstash-output-mongodb plugin v 3.1.5.
My output code is as below:
mongodb {
collection => "TestColection"
database => "TestDB"
codec=> "json"
uri => "mongodb://myusername:mypassword$@001.01.02.03:27017/TestDB?authSource=TestDB&ssl=true&sslallowinvalidcertificate=true"
}
This is throwing below error:
Pipeline terminated by worker error {:pipeline_id=>"main", :exception=>#<Mongo::Error::InvalidURIOption: Invalid option in URI: 'sslallowinvalidcertificate'.
Please see the following URL for more information: http://docs.mongodb.org/manual/reference/connection-string/
>, :backtrace=>["D:/logstash-7.9.0/vendor/bundle/jruby/2.5.0/gems/mongo-2.0.6/lib/mongo/uri.rb:213:in `block in options'", "org/jruby/RubyArray.java:1809:in `each'", "org/jruby/RubyEnumerable.java:1126:in `inject'", "D:/logstash-7.9.0/vendor/bundle/jruby/2.5.0/gems/mongo-2.0.6/lib/mongo/uri.rb:210:in `options'", "D:/logstash-7.9.0/vendor/bundle/jruby/2.5.0/gems/mongo-2.0.6/lib/mongo/uri.rb:153:in `client_options'", "D:/logstash-7.9.0/vendor/bundle/jruby/2.5.0/gems/mongo-2.0.6/lib/mongo/client.rb:267:in `create_from_uri'", "D:/logstash-7.9.0/vendor/bundle/jruby/2.5.0/gems/mongo-2.0.6/lib/mongo/client.rb:150:in `initialize'", "D:/logstash-7.9.0/vendor/bundle/jruby/2.5.0/gems/logstash-output-mongodb-3.1.5/lib/logstash/outputs/mongodb.rb:79:in `register'", "org/logstash/config/ir/compiler/OutputStrategyExt.java:126:in `register'", "org/logstash/config/ir/compiler/AbstractOutputDelegatorExt.java:68:in `register'", "D:/logstash-7.9.0/logstash-core/lib/logstash/java_pipeline.rb:226:in `block in register_plugins'", "org/jruby/RubyArray.java:1809:in `each'", "D:/logstash-7.9.0/logstash-core/lib/logstash/java_pipeline.rb:225:in `register_plugins'", "D:/logstash-7.9.0/logstash-core/lib/logstash/java_pipeline.rb:545:in `maybe_setup_out_plugins'", "D:/logstash-7.9.0/logstash-core/lib/logstash/java_pipeline.rb:238:in `start_workers'", "D:/logstash-7.9.0/logstash-core/lib/logstash/java_pipeline.rb:183:in `run'", "D:/logstash-7.9.0/logstash-core/lib/logstash/java_pipeline.rb:134:in `block in start'"], "pipeline.sources"=>["D:/logstash-7.9.0/work/PractitionerRoleNEW.conf"], :thread=>"#<Thread:0x2305c716 run>"}
I have also tried other options as provided in MongoDB portal
uri => "mongodb://${MongoDBUsername}:${MongoDBPassword}@serverhost:${MongoDBPort}/${MongoDBName}?authSource=${MongoDBName}&tlsAllowInvalidHostnames=true&tlsInsecure=true
But nothing works.
Any idea what I am doing wrong?
TIA!