- download https://dbschema.com/jdbc-drivers/MongoDbJdbcDriver.zip
- udpak og kopier alle filerne til stien(~/logstash-7.4.2/logstash-core/lib/jars/)
- rediger konfigurationsfilen(mongo-logstash.conf) nedenfor:
- kør:~/logstash-7.4.2/bin/logstash -f mongo-logstash.conf
- succes, prøv det!
ps:dette er mit første svar i stackoverflow :-)
input {
jdbc{
# NOT THIS # jdbc_driver_class => "Java::mongodb.jdbc.MongoDriver"
jdbc_driver_class => "com.dbschema.MongoJdbcDriver"
jdbc_driver_library => "mongojdbc1.5.jar"
jdbc_user => "" #no user and pwd
jdbc_password => ""
jdbc_connection_string => "jdbc:mongodb://127.0.0.1:27017/db1"
statement => "db.t1.find()"
}
}
output {
#stdout { codec => dots }
stdout { }
}