Logstash pipeline with MongoDB input jdbc


(Nikhil Mahajan) #1

Hi,

I wanted to create a logstash pipeline to have input from MongoDB and output to ElasticSearch.
Since MongoDB don't have any offcial JDBC driver. So I am using unityjdbc driver for MongoDB.

I have create a simple pipeline and placed it inside bin folder. Here is content of pipleline

input{
jdbc{
jdbc_driver_library => "C:/Program Files/UnityJDBC/mongodb_unityjdbc_full.jar"
jdbc_driver_class => "mongodb.jdbc.MongoDriver"
jdbc_connection_string => "jdbc:mongodb://abc.com:27017/test"
jdbc_user => ""
statement => "*"
}
}

output {
elasticsearch {
hosts => 'http://localhost:9200'
index => 'mongo'
}
stdout { codec => rubydebug }
}

Now when I try to run using command line I am getting error

Command I am using t execute this pipeline on windows is as follows :

C:\logstash-6.1.0\logstash-6.1.0>bin\logstash -f C:\logstash-6.1.0\logstash-6.1.0\bin\logstash-mongo.conf

And I am getting error :

Sending Logstash's logs to C:/logstash-6.1.0/logstash-6.1.0/logs which is now configured via log4j2.properties
[2018-01-05T15:13:02,572][INFO ][logstash.modules.scaffold] Initializing module {:module_name=>"fb_apache", :directory=>"C:/logstash-6.1.0/logstash-6.1.0/modules/fb_apache/configuration"}
[2018-01-05T15:13:02,590][INFO ][logstash.modules.scaffold] Initializing module {:module_name=>"netflow", :directory=>"C:/logstash-6.1.0/logstash-6.1.0/modules/netflow/configuration"}
[2018-01-05T15:13:02,797][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2018-01-05T15:13:03,363][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"6.1.0"}
[2018-01-05T15:13:03,452][INFO ][logstash.config.source.local.configpathloader] No config files found in path {:path=>"C:/logstash-6.1.0/logstash-6.1.0/bin/logstash-mongo.conf"}
[ERROR] 2018-01-05 15:13:03.464 [Ruby-0-Thread-1: C:\logstash-6.1.0\logstash-6.1.0\lib\bootstrap\environment.rb:6] sourceloader - No configuration found in the configured sources.
[2018-01-05T15:13:03,664][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}

Now if I run simple text pipeline i don't see this error


(system) #2

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