# Problems connecting logstash-input-mongodb

**URL:** <https://discuss.elastic.co/t/problems-connecting-logstash-input-mongodb/281186>\
**Category:** Logstash\
**Tags:** docker\
**Created:** [August 12, 2021, 10:18am UTC](https://discuss.elastic.co/t/problems-connecting-logstash-input-mongodb/281186 "2021-08-12T10:18:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LourdesCrespo](https://avatars.discourse-cdn.com/v4/letter/l/aeb1de/32.png) [@LourdesCrespo](https://discuss.elastic.co/u/LourdesCrespo)\
**Post date:** [August 12, 2021, 10:18am UTC](https://discuss.elastic.co/t/problems-connecting-logstash-input-mongodb/281186/1 "2021-08-12T10:18:43Z")

</div>

In the project it is intended that the logs obtained from logstash are sent to mongodb. Docker-compose is used for this and although the containers are connected, the logs are not sent. The part of docker-compose that corresponds to mongodb is the following:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/5/e55361b544c06a4e04044a2cab1799e6951ed95b.png)  
It should also be noted that there is an .env file in which the environment variables are being declared, which would be as follows:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/5/45373a4da401bf32c082c74bcbf2d204392edf02.png)

And the entrypoint of mongodb is:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/7/2718e2a02f596cbf35844e5eca297416540a7453.png)

It seems that the connection is made correctly through docker-compose but the logstash output logs do not appear in the mongo container when fetched in the attach shell with the commands:

- use suricata [to switch to this database]
- db.suricata.find (). pretty () [to search the logs within the suricata database]

---

<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:** [September 9, 2021, 10:18am UTC](https://discuss.elastic.co/t/problems-connecting-logstash-input-mongodb/281186/2 "2021-09-09T10:18:44Z")

</div>

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