# Reading data trough mongodb -input

**URL:** <https://discuss.elastic.co/t/reading-data-trough-mongodb-input/259999>\
**Category:** Logstash\
**Created:** [January 1, 2021, 5:13pm UTC](https://discuss.elastic.co/t/reading-data-trough-mongodb-input/259999 "2021-01-01T17:13:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bucco1958](https://avatars.discourse-cdn.com/v4/letter/b/7ea924/32.png) [@bucco1958](https://discuss.elastic.co/u/bucco1958)\
**Post date:** [January 1, 2021, 5:13pm UTC](https://discuss.elastic.co/t/reading-data-trough-mongodb-input/259999/1 "2021-01-01T17:13:37Z")

</div>

I'm trying to learn more about the mongodb-input-plugin. I'm running a local mongo db instance on my localhost on my Win 10 machine. The database is up and used with other purposes. There is no security on the database - the database can be accessed on the standard monogdb port 27017.

My config file to start logstash looks like this:

```auto

input {
uri => "mongodb://mongodb_host:27017"
placeholder_db_dir => "/Program Files/MongoDB/Server/4.2"
placeholder_db_name => "Cases"
collection => "baby_names"
batch_size => 5000
}

filter {

}
output {
  stdout {
  codec => rubydebug
}
elasticsearch {
action => "index"
index => "baby_newyork_1"
hosts => ["localhost:9200"]
  }
}

```

I started the logstash process like this:

`c:\Programme\Elastic\Logstash\logstash-7.10.1\bin>logstash -f baby_names_monogdb.conf -e`  
The console output that I get after starting the logstash process looks like this:

```auto

Using JAVA_HOME defined java: C:\Program Files\Java\jdk1.8.0_271
WARNING, using JAVA_HOME while Logstash distribution comes with a bundled JDK
Sending Logstash logs to c:/Programme/Elastic/Logstash/logstash-7.10.1/logs which is now configured via log4j2.properties
[2021-01-01T17:07:49,458][INFO][logstash.runner] Starting Logstash {"logstash.version"=>"7.10.1", "jruby.version"=>"jruby 9.2.13.0 (2.5.7) 2020-08-03 9a89c94bcc Java HotSpot(TM) 64-Bit Server VM 25.271-b09 on 1.8.0_271-b09 +indy +jit [mswin32-x86_64]"}
[2021-01-01T17:07:49,745][WARN][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2021-01-01T17:07:50,443][INFO][logstash.config.source.local.configpathloader] No config files found in path {:path=>"c:/Programme/Elastic/Logstash/logstash-7.10.1/bin/baby_names_monogdb.conf"}
[2021-01-01T17:07:50,463][ERROR][logstash.config.sourceloader] No configuration found in the configured sources.
[2021-01-01T17:07:50,958][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=>9600}
[2021-01-01T17:07:55,740][INFO][logstash.runner] Logstash shut down.
[2021-01-01T17:07:55,759][ERROR][org.logstash.Logstash] java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit

```

I assume that the problem could be a wrong formatted connection string ore path in in the input section of the .conf files - I did not find any hints to solve this issue.

All hints and guidance is very welcome.

Kind regards  
Alex

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [January 1, 2021, 5:39pm UTC](https://discuss.elastic.co/t/reading-data-trough-mongodb-input/259999/2 "2021-01-01T17:39:26Z")

</div>

> [@bucco1958](#):
>
> `No config files found in path {:path=>"c:/Programme/Elastic/Logstash/logstash-7.10.1/bin/baby_names_monogdb.conf"}`

You are running logstash in the `c:\Programme\Elastic\Logstash\logstash-7.10.1\bin` directory and only giving a filename with -f, so logstash is looking in that directory for the configuration, but it does not exist there. You can use a relative path or an absolute path with -f to tell logstash where to look for the configuration 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:** [January 29, 2021, 5:39pm UTC](https://discuss.elastic.co/t/reading-data-trough-mongodb-input/259999/3 "2021-01-29T17:39:40Z")

</div>

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