Ad.Champred
Ad.Champred

Reputation: 11

Logstash, mongodb and jdbc

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/"}

Upvotes: 0

Views: 2540

Answers (2)

Val
Val

Reputation: 217274

The MongoDB JDBC Driver setting is not correct. You must specify the name of the driver class, not the client class.

jdbc_driver_class => "mongodb.jdbc.MongoDriver"

Also make sure that the jdbc_driver_library contains the full absolute path to your mongo-java-driver-3.2.2.jar JAR file

Upvotes: 2

Rabbit
Rabbit

Reputation: 162

More inputs would be good. you must specify the location of the mongo-java-driver-3.2.2.jar in jdbc_driver_library.

please see the following links : Documentation Similar problem

Upvotes: 0

Related Questions