# MongoDB Input Plugin to Logstash

**URL:** <https://discuss.elastic.co/t/mongodb-input-plugin-to-logstash/65662>\
**Category:** Logstash\
**Created:** [November 10, 2016, 12:55pm UTC](https://discuss.elastic.co/t/mongodb-input-plugin-to-logstash/65662 "2016-11-10T12:55:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aHazeem](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@aHazeem](https://discuss.elastic.co/u/aHazeem)\
**Post date:** [November 10, 2016, 12:55pm UTC](https://discuss.elastic.co/t/mongodb-input-plugin-to-logstash/65662/1 "2016-11-10T12:55:46Z")

</div>

We are new adopters to ELK and coming from MS background. However, we are trying to switch to the open source world.

We've been already using MongoDB with a new system and we're also trying to use ELK to analyse the data from MongoDB. We found the following unofficial driver:  
[https://github.com/phutchins/logstash-input-mongodb](https://github.com/phutchins/logstash-input-mongodb) .

**The configuration file contains :**

input {  
mongodb {

```
uri => 'mongodb://localhost:27017/my-logs?ssl=true'
placeholder_db_dir => '/opt/logstash-mongodb/'
placeholder_db_name => 'local.db' 
collection => 'jsonsample'
 batch_size => 5000

```

}  
}  
filter {  
}  
output {

elasticsearch {  
host =\> "localhost:9200"  
}  
stdout  
{ codec =\> json }  
}

**Note :** we don't know what does **placeholder\_db\_dir** means .

**The cmd result when typing "logstash -f path/to/config/file.conf" is :**

Sending Logstash logs to C:/logstash-5.0.0/logs which is now configured via log4j2.properties.  
[2016-11-10T14:45:19,801][ERROR][logstash.agent] fetched an invalid config {:config=\>"input {\n mongodb {\n \n uri =\> 'mongodb://localhost:27017/my-logs?ssl=true'\n placeholder\_db\_dir =\> '/opt/logstash-mongodb/'\n placeholder\_db\_name =\> 'local.db' \n collection =\> 'jsonsample'\n\t batch\_size =\> 5000\n }\n}\n\nfilter {\n \n}\n\noutput {\n elasticsearch {\n host =\> "localhost:9200"\n }\n \n stdout\n { codec =\> json }\n}\n", :reason=\>"Couldn't find any input plugin named 'mongodb'. Are you sure this is correct? Trying to load the mongodb input plugin resulted in this error: LoadError"}

appreciated your quick help and support 🙂

---

<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:** [December 8, 2016, 12:55pm UTC](https://discuss.elastic.co/t/mongodb-input-plugin-to-logstash/65662/2 "2016-12-08T12:55:54Z")

</div>

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