Am trying to load mogodb database to elastic search using logstash. I have written below logstash config file and executing it. While running the config file am getting the below error :
Error: mongodb.jdbc.MongoDriver not loaded. Are you sure you've included the correct jdbc driver in :jdbc_driver_library?
Exception: LogStash::ConfigurationError
Am using mongo-java-driver-3.1.0.jar
driver. Please find my logstash config code below.
input {
jdbc {
jdbc_driver_library => "D:\1SearchEngine\data\mongo-java-driver-3.1.0.jar"
jdbc_driver_class => "mongodb.jdbc.MongoDriver"
jdbc_connection_string => "jdbc:mongodb://localhost:27017/my_db"
jdbc_user => ""
statement => "*"
}
}
output {
elasticsearch {
hosts => ["localhost:9200"]
index => "orders"
}
}
Paths on Windows are a little wonky. I cannot verify this at the moment, but in the past I had to use a preceding
/
before the drive letter. And then all/
for the path separators. So give this a try:jdbc_driver_library => "/D:/1SearchEngine/data/mongo-java-driver-3.1.0.jar"
try with mongodb_unityjdbc_full.jar instead of ojdbc14.jar
https://github.com/michaelloliveira/traccar-mongodb/blob/master/lib/mongodb_unityjdbc_full.jar
on windows try:
try double anti slash: (without the space between)
or try single slash: