- scarica https://dbschema.com/jdbc-drivers/MongoDbJdbcDriver.zip
- decomprimi e copia tutti i file nel percorso(~/logstash-7.4.2/logstash-core/lib/jars/)
- modifica il file di configurazione (mongo-logstash.conf) di seguito:
- esegui:~/logstash-7.4.2/bin/logstash -f mongo-logstash.conf
- successo, per favore prova!
ps:questa è la mia prima risposta in 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 { }
}