Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Logstash + MongoDB Atlas OUTPUT : Failed to handshake with xxx.gcp.mongodb.net:27017: ArgumentError: wrong number of arguments (given 2, expected 1)

Trying to output data from Logstash to MongoDB Atlas (cluster running on GCP).

Done :

  • Whitelisted all IPs (0.0.0.0/0)

My logstash config :

input {
  tcp {
    port => 28777
    codec => json
   }
}

output {
   mongodb {
    uri => "mongodb+srv://xxx:[email protected]/collect?retryWrites=true&w=majority&ssl=true"
    database => "collect"
    collection => "requests"
    generateId => true
   }
  stdout {
    codec => json
  }
}

I also tried with this URI :

uri => "mongodb+srv://xxx:[email protected]/?retryWrites=true&w=majority&ssl=true"

But i'm getting :

[2020-09-19T16:01:22,253][WARN ][logstash.outputs.mongodb ][main] MONGODB | Failed to handshake with xxx.gcp.mongodb.net:27017: ArgumentError: wrong number of arguments (given 2, expected 1)
[2020-09-19T16:01:22,253][WARN ][logstash.outputs.mongodb ][main] MONGODB | Failed to handshake with xxx.gcp.mongodb.net:27017: ArgumentError: wrong number of arguments (given 2, expected 1)
[2020-09-19T16:01:22,253][WARN ][logstash.outputs.mongodb ][main] MONGODB | Failed to handshake with xxx.gcp.mongodb.net:27017: ArgumentError: wrong number of arguments (given 2, expected 1)
[2020-09-19T16:01:22,255][WARN ][logstash.outputs.mongodb ][main] MONGODB | Error running ismaster on xxx.gcp.mongodb.net:27017: ArgumentError: wrong number of arguments (given 2, expected 1)
[2020-09-19T16:01:22,255][WARN ][logstash.outputs.mongodb ][main] MONGODB | Error running ismaster on xxx.gcp.mongodb.net:27017: ArgumentError: wrong number of arguments (given 2, expected 1)
[2020-09-19T16:01:22,255][WARN ][logstash.outputs.mongodb ][main] MONGODB | Error running ismaster on xxx.gcp.mongodb.net:27017: ArgumentError: wrong number of arguments (given 2, expected 1)

Update: this happens even if I'm not sending any data.

like image 804
MichelDelpech Avatar asked Oct 19 '25 08:10

MichelDelpech


1 Answers

There is an open issue in the latest version of the plugin. https://github.com/logstash-plugins/logstash-output-mongodb/issues/60

However, plugin version 3.1.5 seems to be working. install it with this command and restart logstash: /usr/share/logstash/bin/logstash-plugin install --version=3.1.5 logstash-output-mongodb

like image 197
Dor Dadush Avatar answered Oct 22 '25 03:10

Dor Dadush



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!