问题
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/"}
回答1:
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
回答2:
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
来源:https://stackoverflow.com/questions/43658663/logstash-mongodb-and-jdbc