# Logstash installed on GCP compute engine having issues connecting to Mongo Atlas

**URL:** <https://discuss.elastic.co/t/logstash-installed-on-gcp-compute-engine-having-issues-connecting-to-mongo-atlas/296461>\
**Category:** Logstash\
**Created:** [February 7, 2022, 12:14pm UTC](https://discuss.elastic.co/t/logstash-installed-on-gcp-compute-engine-having-issues-connecting-to-mongo-atlas/296461 "2022-02-07T12:14:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![justjaidev](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@justjaidev](https://discuss.elastic.co/u/justjaidev)\
**Post date:** [February 7, 2022, 12:14pm UTC](https://discuss.elastic.co/t/logstash-installed-on-gcp-compute-engine-having-issues-connecting-to-mongo-atlas/296461/1 "2022-02-07T12:14:00Z")

</div>

Logstash installed on GCP compute engine is unable to connect Mongo Atlas.. Tried all the below 3 versions of mongo output plugin.

3.1.5  
3.1.6  
3.1.7

Below error observed with 3.1.5 version of mongo output plugin  
[WARN][logstash.outputs.mongodb] Failed to send event to MongoDB, retrying in 3 seconds {:event=\>#LogStash::Event:0x3b46e618, :exception=\>#\<Mongo::Error::NoServerAvailable: No server is available matching preference: #\<Mongo::ServerSelector::Primary:0x507f21fe @tag\_sets=, @server\_selection\_timeout=30, @options={:database=\>"admin", :replica\_set=\>"xxxx", :ssl=\>true, :user=\>"user", :password=\>"pwd"}\>\>}

Below error observed with 3.1.6 and 3.1.7 versions of mongo output plugin  
[logstash.outputs.mongodb] MONGODB | Failed to handshake with [xxxxx.mongodb.net:27017](http://xxxxx.mongodb.net:27017): ArgumentError: wrong number of arguments (given 2, expected 1)

---

<div class="post-metadata">

**Author:** ![zvazquez](https://avatars.discourse-cdn.com/v4/letter/z/c0e974/32.png) [@zvazquez](https://discuss.elastic.co/u/zvazquez)\
**Post date:** [February 28, 2022, 8:33pm UTC](https://discuss.elastic.co/t/logstash-installed-on-gcp-compute-engine-having-issues-connecting-to-mongo-atlas/296461/2 "2022-02-28T20:33:33Z")

</div>

Hi,

Were you able to send data to Atlas Mongo from Logstash? If you can share some light, that will be appreciate it.

Zareh

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 28, 2022, 8:34pm UTC](https://discuss.elastic.co/t/logstash-installed-on-gcp-compute-engine-having-issues-connecting-to-mongo-atlas/296461/3 "2022-03-28T20:34:02Z")

</div>

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