Hi,
Any tips on how to use JDBC to import MongoDB to ES?
MongoDB: test
Tried using mongo-java-driver from http://mongodb.github.io/mongo-java-driver/3.3/driver/getting-started/installation-guide/
Downloaded these files:
bson-3.3.0.jar
mongodb-driver-core-3.3.0.jar
mongo-java-driver-3.3.0.jar
Configuration:
input {
jdbc {
jdbc_driver_library => "driver/mongodb/mongo-java-driver-3.3.0.jar"
jdbc_driver_class => "mongodb.jdbc.MongoDriver"
jdbc_connection_string => "jdbc:mongo://192.168.1.50:27017/test"
jdbc_user => "user"
jdbc_password => "pass"
}
}
Output:
logstash -f mongodb2.conf
Settings: Default pipeline workers: 4
←[31mPipeline aborted due to error {:exception=>"LogStash::ConfigurationError",
:backtrace=>["C:/Users/Michael/Downloads/logstash-2.4.0/logstash-2.4.0/vendor/bu
ndle/jruby/1.9/gems/logstash-input-jdbc-3.1.0/lib/logstash/plugin_mixins/jdbc.rb
:159:in prepare_jdbc_connection'", "C:/Users/Michael/Downloads/logstash-2.4.0/l ogstash-2.4.0/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-3.1.0/lib/logstas h/inputs/jdbc.rb:187:in
register'", "C:/Users/Michael/Downloads/logstash-2.4.0/
logstash-2.4.0/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstas
h/pipeline.rb:330:in start_inputs'", "org/jruby/RubyArray.java:1613:in
each'",
"C:/Users/Michael/Downloads/logstash-2.4.0/logstash-2.4.0/vendor/bundle/jruby/1
.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:329:in start_inputs'" , "C:/Users/Michael/Downloads/logstash-2.4.0/logstash-2.4.0/vendor/bundle/jruby/ 1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:180:in
start_workers
'", "C:/Users/Michael/Downloads/logstash-2.4.0/logstash-2.4.0/vendor/bundle/jrub
y/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:136:in run'", "C:/ Users/Michael/Downloads/logstash-2.4.0/logstash-2.4.0/vendor/bundle/jruby/1.9/ge ms/logstash-core-2.4.0-java/lib/logstash/agent.rb:491:in
start_pipeline'"], :le
vel=>:error}←[0m
stopping pipeline {:id=>"main"}
The signal HUP is in use by the JVM and will not work correctly on this platform
Also tried using UnityJDBC driver with this configuration:
input {
jdbc {
jdbc_driver_library => "C:/Program Files/UnityJDBC/mongodb_unityjdbc_full.jar"
jdbc_driver_class => "mongodb.jdbc.MongoDrivers"
jdbc_connection_string => "jdbc:mongo://192.168.1.50:27017/test"
jdbc_user => "user"
jdbc_password => "pass"
}
}
Output:
logstash -f mongodb.conf
Settings: Default pipeline workers: 4
←[31mPipeline aborted due to error {:exception=>"LogStash::ConfigurationError",
:backtrace=>["C:/Users/Michael/Downloads/logstash-2.4.0/logstash-2.4.0/vendor/bu
ndle/jruby/1.9/gems/logstash-input-jdbc-3.1.0/lib/logstash/plugin_mixins/jdbc.rb
:159:in prepare_jdbc_connection'", "C:/Users/Michael/Downloads/logstash-2.4.0/l ogstash-2.4.0/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-3.1.0/lib/logstas h/inputs/jdbc.rb:187:in
register'", "C:/Users/Michael/Downloads/logstash-2.4.0/
logstash-2.4.0/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstas
h/pipeline.rb:330:in start_inputs'", "org/jruby/RubyArray.java:1613:in
each'",
"C:/Users/Michael/Downloads/logstash-2.4.0/logstash-2.4.0/vendor/bundle/jruby/1
.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:329:in start_inputs'" , "C:/Users/Michael/Downloads/logstash-2.4.0/logstash-2.4.0/vendor/bundle/jruby/ 1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:180:in
start_workers
'", "C:/Users/Michael/Downloads/logstash-2.4.0/logstash-2.4.0/vendor/bundle/jrub
y/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:136:in run'", "C:/ Users/Michael/Downloads/logstash-2.4.0/logstash-2.4.0/vendor/bundle/jruby/1.9/ge ms/logstash-core-2.4.0-java/lib/logstash/agent.rb:491:in
start_pipeline'"], :le
vel=>:error}←[0m
stopping pipeline {:id=>"main"}
The signal HUP is in use by the JVM and will not work correctly on this platform