# MongoDB Atlas Integration with Logstash through logstash-output-mongodb plugin

**URL:** <https://discuss.elastic.co/t/mongodb-atlas-integration-with-logstash-through-logstash-output-mongodb-plugin/217500>\
**Category:** Logstash\
**Created:** [February 1, 2020, 4:15pm UTC](https://discuss.elastic.co/t/mongodb-atlas-integration-with-logstash-through-logstash-output-mongodb-plugin/217500 "2020-02-01T16:15:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rodher](https://avatars.discourse-cdn.com/v4/letter/r/50afbb/32.png) [@rodher](https://discuss.elastic.co/u/rodher)\
**Post date:** [February 1, 2020, 4:15pm UTC](https://discuss.elastic.co/t/mongodb-atlas-integration-with-logstash-through-logstash-output-mongodb-plugin/217500/1 "2020-02-01T16:15:33Z")

</div>

Hi  
I am trying to connect Logstash with MongoDB Atlas using logstash-output-mongodb plugin. However, some issues happen.  
Currently, I am using logstash 6.7.2, and logtsash-output-plugin version 3.1.6  
The integration I want to implement is Kafka --\> Logtsash --\> MogoDB Atlas (Logstash reads from Kafka fine).  
The following is the configuration in the output:

mongodb {  
uri =\> "mongodb+srv://user:password@connection\_string\_uri.net/dbname?replicaSet=myRepl&retryWrites=true&w=majority&ssl=true"  
database =\> "dbname"  
collection =\> "collection\_name"  
generateId =\> true  
id =\> "afng\_audit\_info"  
}

Currently the issue is:

[2020-02-01T11:12:50,275][WARN][logstash.outputs.mongodb] Failed to send event to MongoDB, retrying in 3 seconds {:event=\>#LogStash::Event:0x98eb8c07, :exception=\>#\<Mongo::Error::NoServerAvailable: No primary server is available in cluster: #\<Cluster topology=ReplicaSetNoPrimary[[cluster-name-shard-00-00-cptml.azure.mongodb.net:27017](http://cluster-name-shard-00-00-cptml.azure.mongodb.net:27017),[cluster-name-shard-00-01-cptml.azure.mongodb.net:27017](http://cluster-name-shard-00-01-cptml.azure.mongodb.net:27017),[cluster-name-shard-00-02-cptml.azure.mongodb.net:27017](http://cluster-name-shard-00-02-cptml.azure.mongodb.net:27017),name=myRepl] servers=[#,#,#]\> with timeout=30, LT=0.015\>}

I am sure the cluster is enable: I can acces through Compass or Mongo Shell

Please, some tips, advices o recommendations using logstash-output-mongodb to integrate to MongoDB Atlas

Thanks in advance

---

<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:** [February 29, 2020, 4:15pm UTC](https://discuss.elastic.co/t/mongodb-atlas-integration-with-logstash-through-logstash-output-mongodb-plugin/217500/2 "2020-02-29T16:15:33Z")

</div>

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