# Logstash: Error: mongodb.jdbc.MongoDriver not loaded. Are you sure you've included the correct jdbc driver in :jdbc\_driver\_library?

**URL:** <https://discuss.elastic.co/t/logstash-error-mongodb-jdbc-mongodriver-not-loaded-are-you-sure-youve-included-the-correct-jdbc-driver-in-jdbc-driver-library/93418>\
**Category:** Logstash\
**Created:** [July 17, 2017, 3:23pm UTC](https://discuss.elastic.co/t/logstash-error-mongodb-jdbc-mongodriver-not-loaded-are-you-sure-youve-included-the-correct-jdbc-driver-in-jdbc-driver-library/93418 "2017-07-17T15:23:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![PravinDwiwedi](https://avatars.discourse-cdn.com/v4/letter/p/b5ac83/32.png) [@PravinDwiwedi](https://discuss.elastic.co/u/PravinDwiwedi)\
**Post date:** [July 17, 2017, 3:23pm UTC](https://discuss.elastic.co/t/logstash-error-mongodb-jdbc-mongodriver-not-loaded-are-you-sure-youve-included-the-correct-jdbc-driver-in-jdbc-driver-library/93418/1 "2017-07-17T15:23:39Z")

</div>

Hi,

I am getting below error while using Mongodb Java Driver to ready data from MongoDB and push it to ES-  
Error: mongodb.jdbc.MongoDriver not loaded. Are you sure you've included the correct jdbc driver in :jdbc\_driver\_library?

**Plateform**  
OS- RHEL 6.6  
Logstash- 5.5.0  
Mongodb- 3.2.13  
Jars- mongodb-driver-core-3.4.2, mongo-java-driver-3.4.2, bson-3.4.2

**Logstash config**  
input{  
jdbc{  
jdbc\_driver\_library =\> "/home/pdwiwe/logstash-5.5.0/bin/mongo-java-driver-3.4.2.jar"  
jdbc\_driver\_class =\> "mongodb.jdbc.MongoDriver"  
jdbc\_connection\_string =\> "jdbc:mongo://hostname:27017?authSource=admin"  
jdbc\_user =\> "user"  
jdbc\_password =\> "pwd"  
statement =\> "select \* from system.users"  
}  
}  
output {  
if "\_grokparsefailure" not in [tags]{  
elasticsearch {  
hosts =\> ["localhost:9200"]  
index =\> "mongodb-data"  
}  
}   
}

**Start Logstash**  
/home/pdwiwe/logstash-5.5.0/bin$ sh logstash -f mongo.conf

Please help me where I am wrong....

---

<div class="post-metadata">

**Author:** ![jsvd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsvd/32/6203_2.png) [@jsvd](https://discuss.elastic.co/u/jsvd)\
**Post date:** [July 21, 2017, 3:12pm UTC](https://discuss.elastic.co/t/logstash-error-mongodb-jdbc-mongodriver-not-loaded-are-you-sure-youve-included-the-correct-jdbc-driver-in-jdbc-driver-library/93418/2 "2017-07-21T15:12:16Z")

</div>

can you show me the error you're seeing? did you download the .jar and place it in `/home/pdwiwe/logstash-5.5.0/bin/`?

---

<div class="post-metadata">

**Author:** ![PravinDwiwedi](https://avatars.discourse-cdn.com/v4/letter/p/b5ac83/32.png) [@PravinDwiwedi](https://discuss.elastic.co/u/PravinDwiwedi)\
**Post date:** [July 21, 2017, 8:28pm UTC](https://discuss.elastic.co/t/logstash-error-mongodb-jdbc-mongodriver-not-loaded-are-you-sure-youve-included-the-correct-jdbc-driver-in-jdbc-driver-library/93418/3 "2017-07-21T20:28:44Z")

</div>

Thanks jsvd...

yes, below .jar are there.

All the jars are downloaded from - [https://mvnrepository.com/artifact/org.mongodb/mongodb-driver-core/3.4.2](https://mvnrepository.com/artifact/org.mongodb/mongodb-driver-core/3.4.2)

- mongodb-driver-core-3.4.2.jar
- mongo-java-driver-3.4.2.jar
- bson-3.4.2.jar

Below is the full error log--  
**-sh-4.1$ sh logstash -f mongo.conf**  
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.  
Sending Logstash's logs to /home/pdwiwe/logstash-5.5.0/logs which is now configured via log4j2.properties  
[2017-07-21T20:24:28,234][INFO][logstash.outputs.elasticsearch] Elasticsearch pool URLs updated {:changes=\>{:removed=\>[], :added=\>[[http://localhost:9200/](http://localhost:9200/)]}}  
[2017-07-21T20:24:28,268][INFO][logstash.outputs.elasticsearch] Running health check to see if an Elasticsearch connection is working {:healthcheck\_url=\>[http://localhost:9200/](http://localhost:9200/), :path=\>"/"}  
[2017-07-21T20:24:28,639][WARN][logstash.outputs.elasticsearch] Restored connection to ES instance {:url=\>#Java::JavaNet::URI:0x197bbe26}  
[2017-07-21T20:24:28,641][INFO][logstash.outputs.elasticsearch] Using mapping template from {:path=\>nil}  
[2017-07-21T20:24:28,759][INFO][logstash.outputs.elasticsearch] Attempting to install template {:manage\_template=\>{"template"=\>"logstash-_", "version"=\>50001, "settings"=\>{"index.refresh\_interval"=\>"5s"}, "mappings"=\>{"default"=\>{"\_all"=\>{"enabled"=\>true, "norms"=\>false}, "dynamic\_templates"=\>[{"message\_field"=\>{"path\_match"=\>"message", "match\_mapping\_type"=\>"string", "mapping"=\>{"type"=\>"text", "norms"=\>false}}}, {"string\_fields"=\>{"match"=\>"_", "match\_mapping\_type"=\>"string", "mapping"=\>{"type"=\>"text", "norms"=\>false, "fields"=\>{"keyword"=\>{"type"=\>"keyword", "ignore\_above"=\>256}}}}}], "properties"=\>{"@timestamp"=\>{"type"=\>"date", "include\_in\_all"=\>false}, "@version"=\>{"type"=\>"keyword", "include\_in\_all"=\>false}, "geoip"=\>{"dynamic"=\>true, "properties"=\>{"ip"=\>{"type"=\>"ip"}, "location"=\>{"type"=\>"geo\_point"}, "latitude"=\>{"type"=\>"half\_float"}, "longitude"=\>{"type"=\>"half\_float"}}}}}}}}  
[2017-07-21T20:24:28,789][INFO][logstash.outputs.elasticsearch] New Elasticsearch output {:class=\>"LogStash::Outputs::ElasticSearch", :hosts=\>[#Java::JavaNet::URI:0x7c32be81]}  
[2017-07-21T20:24:28,796][INFO][logstash.pipeline] Starting pipeline {"id"=\>"main", "pipeline.workers"=\>4, "pipeline.batch.size"=\>125, "pipeline.batch.delay"=\>5, "pipeline.max\_inflight"=\>500}  
[2017-07-21T20:24:29,146][INFO][logstash.pipeline] Pipeline main started  
[2017-07-21T20:24:29,306][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=\>9600}  
[2017-07-21T20:24:29,638][ERROR][logstash.pipeline] A plugin had an unrecoverable error. Will restart this plugin.  
Plugin: \<LogStash::Inputs::Jdbc jdbc\_driver\_library=\>"mongodb-driver-core-3.4.2.jar", jdbc\_driver\_class=\>"mongodb.jdbc.MongoDriver", jdbc\_connection\_string=\>"jdbc:mongo://host:27017?authSource=admin", jdbc\_user=\>"admin", jdbc\_password=\>, statement=\>"select \* from system.users", id=\>"3dc5c2b10eba8dfb0703222b3b3ae5ed228b8636-1", enable\_metric=\>true, codec=\>\<LogStash::Codecs::Plain id=\>"plain\_e4f395aa-de63-4157-9ffa-063833d3955e", enable\_metric=\>true, charset=\>"UTF-8"\>, jdbc\_paging\_enabled=\>false, jdbc\_page\_size=\>100000, jdbc\_validate\_connection=\>false, jdbc\_validation\_timeout=\>3600, jdbc\_pool\_timeout=\>5, sql\_log\_level=\>"info", connection\_retry\_attempts=\>1, connection\_retry\_attempts\_wait\_time=\>0.5, parameters=\>{"sql\_last\_value"=\>1970-01-01 00:00:00 UTC}, last\_run\_metadata\_path=\>"/home/pdwiwe/.logstash\_jdbc\_last\_run", use\_column\_value=\>false, tracking\_column\_type=\>"numeric", clean\_run=\>false, record\_last\_run=\>true, lowercase\_column\_names=\>true\>  
Error: mongodb.jdbc.MongoDriver not loaded. Are you sure you've included the correct jdbc driver in :jdbc\_driver\_library?

---

<div class="post-metadata">

**Author:** ![PravinDwiwedi](https://avatars.discourse-cdn.com/v4/letter/p/b5ac83/32.png) [@PravinDwiwedi](https://discuss.elastic.co/u/PravinDwiwedi)\
**Post date:** [August 9, 2017, 7:04pm UTC](https://discuss.elastic.co/t/logstash-error-mongodb-jdbc-mongodriver-not-loaded-are-you-sure-youve-included-the-correct-jdbc-driver-in-jdbc-driver-library/93418/4 "2017-08-09T19:04:39Z")

</div>

any Help!

---

<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 6, 2017, 7:04pm UTC](https://discuss.elastic.co/t/logstash-error-mongodb-jdbc-mongodriver-not-loaded-are-you-sure-youve-included-the-correct-jdbc-driver-in-jdbc-driver-library/93418/5 "2017-09-06T19:04:41Z")

</div>

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