3

I need help in installing MongoDB input plugin in logstash and the config file to connect with MongoDB. I am using ElasticSearch-Logstash in Windows Os.

I have the Logstash-input-MongoDB plugin zip file. what are the steps for manual installation.

2 Answers 2

3

First you should know that there is no official mongodb input plugin for logstash. Please take a look at logstash's official plugin list.

I don't know where you got your zip file but you should use logstash's built-in plugin manager to install new plugins. The manual installation is much more complex. Use the following command to install a community based mongodb input plugin:

$LS_HOME/bin/plugin install logstash-input-mongodb

It will install this RubyGem for you. According to its documentation (which can be found on GitHub) it could be used like this:

input {
  mongodb {
    uri => 'mongodb://10.0.0.30/my-logs?ssl=true'
    path => '/opt/logstash-mongodb/logstash_sqlite.db'
    collection => 'events_'
    unpack_mongo_id => true
    batch_size => 5000
  }
}

However, since this is a non-official plugin you might experience some bugs.

Sign up to request clarification or add additional context in comments.

6 Comments

may i know which path does this line mean {path => '/opt/logstash-mongodb/logstash_sqlite.db'}
I am getting an error like "uninitialized constant Mongo::URI" when running the logstash for connecting mongodb using logstash-input-mongodb plugin. can you help me resolve this issue.
Could be the same bug as in logstash-output-mongodb. I've posted an answer to this issue here: stackoverflow.com/questions/31652436/…
ya i have tried that but it does not work for input plugin. output plugin is to add a document to mongodb right?
@php.khan Yes. my-logs is the database. docs.mongodb.org/manual/reference/connection-string
|
1

The use of "LS_HOME/bin/plugin" is deprecated and will be removed in a feature release. Please use "LS_HOME/bin/logstash-plugin".

You can install this plugin using command given below:

cd LS_HOME/bin/ && sudo ./logstash-plugin install logstash-input-mongodb

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.