# MongoDB elasticsearch using logstash error

**URL:** <https://discuss.elastic.co/t/mongodb-elasticsearch-using-logstash-error/252347>\
**Category:** Logstash\
**Created:** [October 16, 2020, 1:05pm UTC](https://discuss.elastic.co/t/mongodb-elasticsearch-using-logstash-error/252347 "2020-10-16T13:05:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manuang](https://avatars.discourse-cdn.com/v4/letter/m/e36b37/32.png) [@Manuang](https://discuss.elastic.co/u/Manuang)\
**Post date:** [October 16, 2020, 1:05pm UTC](https://discuss.elastic.co/t/mongodb-elasticsearch-using-logstash-error/252347/1 "2020-10-16T13:05:28Z")

</div>

I am trying to connect mongodb to elastic search. I am using Mongodb compass and in that the database is MongoPOC and collection is Json\_file. My config file is as below:  
MongoDB 4.2.10 Enterprise  
Cluster Standalone

input {  
mongodb  
{  
codec=\> "json"  
uri=\> "mongodb://localhost:27017/MongoPOC"  
placeholder\_db\_dir=\> 'D:/airbnb/logstash-7.9.2'  
placeholder\_db\_name=\> 'airbnb1\_sqlite.db'  
collection=\> 'Json\_file'  
batch\_size=\> 1000  
}  
}  
output {  
elasticsearch {  
index =\> "mongotest1"  
hosts =\> ["127.0.0.1:9200"]  
}  
}  
Can anyone help me with correct configuration.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:** [November 13, 2020, 1:05pm UTC](https://discuss.elastic.co/t/mongodb-elasticsearch-using-logstash-error/252347/2 "2020-11-13T13:05:34Z")

</div>

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