Logstash and mongodb connection using JDBC is not working

This is the configuration file gives output as [unable to connect to database and no suitable driver was found!] and I am using logstash version 7.5.1

@SanTiaGo_KarThiCk Can you try removing the jdbc_driver_library setting from your configuration and copying mongojdbc1.6.jar onto a location on the Logstash classpath? (<LOGSTASH_HOME_DIRECTORY>/logstash-core/lib/jars)

Its Some what better than previoous but it facing the error: [ no com/mongodb/MongoClientURI class not found]

1 Like

[2020-02-14T14:48:03,395][ERROR][logstash.inputs.jdbc ] Unable to connect to database. Tried 1 times {:error_message=>"Java::JavaLang::NoClassDefFoundError: com/mongodb/event/ServerMonitorListener"}

this is error now i am facing

1 Like

@SanTiaGo_KarThiCk I'm no MongoDB expert, but I suspect there are still some missing dependencies. I did a search for that class, and it looks like it comes from the MongoDB java driver (as opposed to the MongoDB JDBC driver). You will need to add that, plus any other dependencies that MongoDB requires to the classpath in addition to the JDBC driver you have already added.

Thanks Rob its working with java-driver along with JDBC driver

1 Like

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