Read MongoDB data into logstash

Hi

I am trying to read the data from MongoDB into my logstash but I am getting error with driver file it seems.

Below is the snippet of my logstash conf file:

input {
jdbc {
jdbc_driver_library => "C:\ELK\logstash\bin\mongo-java-driver-3.5.0.jar"
jdbc_driver_class => "mongodb.jdbc.MongoDriver"
jdbc_connection_string => "jdbc:mongo://locahost:27017/elklog"
jdbc_user => "admin"
schedule => "* * * * *"
statement => "db.mongolog.find()"
}
}

elklog is my db name and mongolog is my table.

When I run logstash, I get below error:

Blockquote
6261334 rufus-scheduler intercepted an error:
6261334 job:
6261334 Rufus::Scheduler::CronJob "* * * * *" {}
6261334 error:
6261334 6261334
6261334 LogStash::ConfigurationError
6261334 mongodb.jdbc.MongoDriver not loaded. Are you sure you've included the correct jdbc driver in :jdbc_driver_library?
6261334 C:/ELK/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-4.2.1/lib/logstash/plugin_mixins/jdbc.rb:157:in open_jdbc_connection' 6261334 C:/ELK/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-4.2.1/lib/logstash/plugin_mixins/jdbc.rb:149:in open_jdbc_connection'
6261334 C:/ELK/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-4.2.1/lib/logstash/plugin_mixins/jdbc.rb:217:in execute_statement' 6261334 C:/ELK/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-4.2.1/lib/logstash/inputs/jdbc.rb:272:in execute_query'
6261334 C:/ELK/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-4.2.1/lib/logstash/inputs/jdbc.rb:250:in run' 6261334 org/jruby/RubyProc.java:281:in call'
6261334 C:/ELK/logstash/vendor/bundle/jruby/1.9/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:234:in do_call' 6261334 C:/ELK/logstash/vendor/bundle/jruby/1.9/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:258:in do_trigger'
6261334 C:/ELK/logstash/vendor/bundle/jruby/1.9/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:300:in start_work_thread' 6261334 org/jruby/RubyProc.java:281:in call'
6261334 C:/ELK/logstash/vendor/bundle/jruby/1.9/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:299:in start_work_thread' 6261334 org/jruby/RubyKernel.java:1479:in loop'
6261334 C:/ELK/logstash/vendor/bundle/jruby/1.9/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:289:in `start_work_thread'
6261334 tz:

Can anyone please help me with the issue.

Thanks

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.