Logstash, mongodb and jdbc

萝らか妹 提交于 2020-01-25 23:53:27

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!