# Installing Mongodb input plugin in Logstash

**URL:** <https://discuss.elastic.co/t/installing-mongodb-input-plugin-in-logstash/113886>\
**Category:** Logstash\
**Created:** [January 3, 2018, 7:51am UTC](https://discuss.elastic.co/t/installing-mongodb-input-plugin-in-logstash/113886 "2018-01-03T07:51:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mahajan344](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@mahajan344](https://discuss.elastic.co/u/mahajan344)\
**Post date:** [January 3, 2018, 7:51am UTC](https://discuss.elastic.co/t/installing-mongodb-input-plugin-in-logstash/113886/1 "2018-01-03T07:51:51Z")

</div>

Hello,

I have a MongoDB database and I want to create a pipeline in Logstash to transfer data from MongoDb to Elasticsearch using Logstash.

I have installed Elasticsearch latest version 6.1 and I checked official website and found that there is no input plugin for MongoDB.

But there are two GitHub repo available for MongoDB input plugin for logstash

1. [GitHub - kurkop/logstash-input-mongodb: MongoDB input plugin for Logstash](https://github.com/kurkop/logstash-input-mongodb) (last commited on Dec 18,2015 and have .gem file)
2. [GitHub - phutchins/logstash-input-mongodb: MongoDB input plugin for Logstash](https://github.com/phutchins/logstash-input-mongodb) (last commited on May 4,2017 but no .gem file included)

Now If I install 1st one then I am getting error of compatibility. Here is error I am getting

> ERROR: An error occured when installing the: file:///E:/Office/mongodb-old/logstash-input-mongodb-master.zip, to have more information about the error add a DEBUG=1 before running the command., message: Bundler could not find compatible versions for gem "logstash-core":  
> In snapshot (Gemfile.lock):  
> logstash-core (= 6.1.0)
> 
> In Gemfile:  
> logstash-core-plugin-api (\>= 0) java depends on  
> logstash-core (= 6.1.0) java
> 
> ```
> logstash-input-syslog (>= 0) java depends on
> logstash-filter-grok (>= 0) java depends on
> logstash-core (>= 5.6.0) java
> 
> logstash-input-mongodb (= 0.3.3) java depends on
> logstash-core (< 3.0.0, >= 2.0.0.beta2) java
> 
> logstash-core (>= 0) java
> 
> ```
> 
> Running `bundle update` will rebuild your snapshot from scratch, using only  
> the gems in your Gemfile, which may resolve the conflict.

So its not compatible with latest version.

1. If I install 2nd one, I am getting error below

> ERROR: Invalid pack for: file:///E:/Office/logstash-input-mongodb-master.zip, reason: The pack must contains at least one plugin, message: The pack must contains at least one plugin

may be because it doesn't contain any .gem file ?

So how I create logstash pipeline to transfer data from MongoDb to Elasticsearch ?

---

<div class="post-metadata">

**Author:** ![mahajan344](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@mahajan344](https://discuss.elastic.co/u/mahajan344)\
**Post date:** [January 4, 2018, 5:32am UTC](https://discuss.elastic.co/t/installing-mongodb-input-plugin-in-logstash/113886/2 "2018-01-04T05:32:49Z")

</div>

no one interested to reply ?

---

<div class="post-metadata">

**Author:** ![guyboertje](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guyboertje/32/31592_2.png) [@guyboertje](https://discuss.elastic.co/u/guyboertje)\
**Post date:** [January 4, 2018, 1:57pm UTC](https://discuss.elastic.co/t/installing-mongodb-input-plugin-in-logstash/113886/3 "2018-01-04T13:57:25Z")

</div>

You can investigate using JBDC. There are some non-free 3rd party jars from some integrations vendors.

Then you **might** be able to use the [JDBC input](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html).

Other alternatives:

- Create a [MongoDB http server](https://docs.mongodb.com/ecosystem/tools/http-interfaces/) and use the http\_poller input to fetch records over http.
- Use `mongoexport` to a JSON or CSV file.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 1, 2018, 1:57pm UTC](https://discuss.elastic.co/t/installing-mongodb-input-plugin-in-logstash/113886/4 "2018-02-01T13:57:33Z")

</div>

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