I am using logstash-1.5.2 with mongodb 3.0.4. and I am trying to start the logstash with below configuration which is not working.
input{
stdin{
}
}
output {
mongodb {
database => "logdb"
collection => "plain"
uri => "mongodb://localhost:27017"
} }
I am facing below errror :
./logstash -f conf/mongo.conf
The error reported is: uninitialized constant Mongo::URIParser
Please help.
The problem is caused by a bug in the latest version of logstash-output-mongodb. Please see the issue reported on github. It can be fixed by changing a few lines inside the mongodb plugin. (Please be careful, as this is a hacky solution which neither supports authentication nor remote servers.)
Change the lines of your mongo.rb file as mentioned here. (path should be something like
/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-mongodb-0.1.4/lib/logstash/outputs/mongodb.rb
You can find the exact path in your error message.)Replace:
by:
And replace:
by:
I had this issue myself in several logstash setups. Changing the lines did the trick for me everytime.