Logstash, Mongodb and JDBC


(Adri) #1

Hi,

I have a problem configuring logstash. I want to be able to put in input jdbc for mongodb.
My config :
input{
jdbc{
jdbc_driver_library => "mongo-java-driver-3.2.2.jar"
jdbc_driver_class => "com.mongodb.MongoClient"
jdbc_connection_string => "jdbc:mongodb://localhost:27017"
jdbc_user => ""
}
}
output{
stdout{

}

}

The problem is :
:error=>"Java::JavaSql::SQLException: No suitable driver found for jdbc:mongodb://localhost:27017/"}


(Javier) #2

HI Adri:

Could you try using jdbc_driver_class => "Java::com.mongodb.MongoClient" ?
Regards


(Adri) #3

Yes, it's the same answer.


(Javier) #4

Hi again:

Is this driver the one from Unity?. Case it is Unity doc says that driver class is mongodb.jdbc.MongoDriver (note there is not com. prefix)

http://www.unityjdbc.com/support/doc/full/unityjdbcdoc.html#d6e475


#5

"mongo-java-driver-3.2.2.jar" is the name of the official mongodb java library. This library does not implement JDBC, so it will not work. You need to look for JDBC driver.


(system) #6

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