java::mongodb.jdbc.MongoDriver not loaded. Are you sure you've included the correct jdbc driver in :jdbc_driver_library


I am getting error while using Mongodb Driver.

logstash conf file

input {
jdbc {

jdbc_driver_library => "C://elk//logstash//bin//unityjdbc.jar"
jdbc_driver_class => "java::mongodb.jdbc.MongoDriver"
jdbc_connection_string => "jdbc:mongo://localhost:27017/myDb"
jdbc_user => ""
jdbc_password => ""
jdbc_validate_connection => true
statement => "db.past.find()"
tags => "mongodb"


output {
elasticsearch {
hosts => ["localhost:9200"]
index => "contacts"
document_type => "contact"
document_id => "%{uid}"

stdout { codec => rubydebug } 


[2017-11-09T10:36:16,869][ERROR][logstash.pipeline ] A plugin had an unrecoverable error. Will restart this plugin.
Plugin: <LogStash::Inputs::Jdbc jdbc_driver_library=>"C://elk//logstash//bin//unityjdbc.jar", jdbc_driver_class=>"java::mongodb.jdbc.MongoDriver", jdbc_connection_string=>"jdbc:mongo://localhost:27017/myDb", jdbc_password=>, jdbc_validate_connection=>true, statement=>"db.past.find()", tags=>["mongodb"], id=>"79b7810d654c0eceb011c9c78c294342530aea69-1", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_d14e6f56-39e2-46a4-af99-f17e2964935e", enable_metric=>true, charset=>"UTF-8">, jdbc_paging_enabled=>false, jdbc_page_size=>100000, 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=>"C:\Windows\system32\config\systemprofile/.logstash_jdbc_last_run", use_column_value=>false, tracking_column_type=>"numeric", clean_run=>false, record_last_run=>true, lowercase_column_names=>true>
Error: java::mongodb.jdbc.MongoDriver not loaded. Are you sure you've included the correct jdbc driver in :jdbc_driver_library?

Can anyone please help me to resolve the error ?

Make sure you use the JDBC JAR file mongodb_unityjdbc_full.jar. When you download the install program, the JAR file is UnityJDBC_Trial_Install.jar which needs to be run by using the command: java -jar UnityJDBC_Trial_install.jar

The mongodb_unityjdbc_full.jar will be in the installation directory after install is complete.

1 Like

Thanks Lawrence. This resolved the issue

This not work for me. I'm still getting error.

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