MongoDB Input Plugin to Logstash

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 .

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 :slight_smile:

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