# Error in Logstash Pipeline

**URL:** <https://discuss.elastic.co/t/error-in-logstash-pipeline/267930>\
**Category:** Logstash\
**Created:** [March 22, 2021, 2:16am UTC](https://discuss.elastic.co/t/error-in-logstash-pipeline/267930 "2021-03-22T02:16:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![caitlyn.carlisle](https://avatars.discourse-cdn.com/v4/letter/c/edb3f5/32.png) [@caitlyn.carlisle](https://discuss.elastic.co/u/caitlyn.carlisle)\
**Post date:** [March 22, 2021, 2:16am UTC](https://discuss.elastic.co/t/error-in-logstash-pipeline/267930/1 "2021-03-22T02:16:18Z")

</div>

I am getting this error when trying to run my Logstash pipeline. I would appreciate any help!! Thanks so much!

```auto
[2021-03-21T22:02:58,827][WARN][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2021-03-21T22:02:59,683][ERROR][logstash.agent] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of [\\t\\r\\n], \"#\", \"{\" at line 2, column 13 (byte 21) after input {\n uri ", :backtrace=>["/Users/caitlyn/Desktop/logstash-7.11.2/logstash-core/lib/logstash/compiler.rb:32:in `compile_imperative'", "org/logstash/execution/AbstractPipelineExt.java:184:in `initialize'", "org/logstash/execution/JavaBasePipelineExt.java:69:in `initialize'", "/Users/caitlyn/Desktop/logstash-7.11.2/logstash-core/lib/logstash/java_pipeline.rb:47:in `initialize'", "/Users/caitlyn/Desktop/logstash-7.11.2/logstash-core/lib/logstash/pipeline_action/create.rb:52:in `execute'", "/Users/caitlyn/Desktop/logstash-7.11.2/logstash-core/lib/logstash/agent.rb:371:in `block in converge_state'"]}
[2021-03-21T22:03:00,039][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=>9600}
[2021-03-21T22:03:04,968][INFO][logstash.runner] Logstash shut down.
[2021-03-21T22:03:04,988][FATAL][org.logstash.Logstash] Logstash stopped processing because of an error: (SystemExit) exit
org.jruby.exceptions.SystemExit: (SystemExit) exit
	at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:747) ~[jruby-complete-9.2.13.0.jar:?]
	at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:710) ~[jruby-complete-9.2.13.0.jar:?]
	at Users.caitlyn.desktop.logstash_minus_7_dot_11_dot_2.lib.bootstrap.environment.<main>(/Users/caitlyn/desktop/logstash-7.11.2/lib/bootstrap/environment.rb:89) ~[?:?]

```

```auto
input {
        uri => 'mongodb://username:password@152.3.22.155'
        placeholder_db_dir => '/Users/caitlyn/desktop/logstash-7.11.2/bin'
        placeholder_db_name => 'logstash_sqlite.db'
        collection => 'ml4p'
        batch_size => 5000
}
filter {

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

```

---

<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:** [March 22, 2021, 2:50am UTC](https://discuss.elastic.co/t/error-in-logstash-pipeline/267930/2 "2021-03-22T02:50:40Z")

</div>

> [@caitlyn.carlisle](#):
>
> ```auto
> input {
> uri => 'mongodb://username:password@152.3.22.155'
> 
> ```

You need to tell logstash which input you are trying to configure. I would start with

```
input {
    mongodb {
        uri => 'mongodb://username:password@152.3.22.155'
        placeholder_db_dir => '/Users/caitlyn/desktop/logstash-7.11.2/bin'
        placeholder_db_name => 'logstash_sqlite.db'
        collection => 'ml4p'
        batch_size => 5000
    }
}

```

I do not think the mongodb input is installed by default so you will need to install it.

---

<div class="post-metadata">

**Author:** ![caitlyn.carlisle](https://avatars.discourse-cdn.com/v4/letter/c/edb3f5/32.png) [@caitlyn.carlisle](https://discuss.elastic.co/u/caitlyn.carlisle)\
**Post date:** [March 29, 2021, 5:23pm UTC](https://discuss.elastic.co/t/error-in-logstash-pipeline/267930/3 "2021-03-29T17:23:02Z")

</div>

Thank you! That worked but now I am getting this error:

`WARN -- : MONGODB | Failed to authenticate to 152.3.22.155:27017: Mongo::Auth::Unauthorized: User cait (mechanism: scram) is not authorized to access admin (auth source: admin, used mechanism: SCRAM-SHA-1, used server: 152.3.22.155:27017 (STANDALONE)): Authentication failed. (18: AuthenticationFailed)`

Do you have to have insert privileges in MongoDB for it to work?

---

<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:** [March 29, 2021, 6:11pm UTC](https://discuss.elastic.co/t/error-in-logstash-pipeline/267930/4 "2021-03-29T18:11:16Z")

</div>

It needs to be able to .connect to the database and to .find entries. I do not know anything about the mongodb permissions model so I cannot say what privileges it needs.

---

<div class="post-metadata">

**Author:** ![caitlyn.carlisle](https://avatars.discourse-cdn.com/v4/letter/c/edb3f5/32.png) [@caitlyn.carlisle](https://discuss.elastic.co/u/caitlyn.carlisle)\
**Post date:** [March 30, 2021, 3:32am UTC](https://discuss.elastic.co/t/error-in-logstash-pipeline/267930/5 "2021-03-30T03:32:55Z")

</div>

Thank you for your help!

---

<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:** [April 27, 2021, 3:33am UTC](https://discuss.elastic.co/t/error-in-logstash-pipeline/267930/6 "2021-04-27T03:33:21Z")

</div>

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