# LogStash conf file help

**URL:** https://discuss.elastic.co/t/logstash-conf-file-help/273705
**Category:** Logstash
**Created:** [May 21, 2021, 9:20pm UTC](https://discuss.elastic.co/t/logstash-conf-file-help/273705 "2021-05-21T21:20:38Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![jasieltego](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasieltego/32/77950_2.png) [@jasieltego](https://discuss.elastic.co/u/jasieltego)
#### Post date: [May 21, 2021, 9:20pm UTC](https://discuss.elastic.co/t/logstash-conf-file-help/273705/1 "2021-05-21T21:20:38Z")

</div>

Hi,

I have created a logstash conf file. It's just bare bones, trying to get the service up and running so I can practice on my PC. This is what's in the file.  
`input {

`stdin {}

`}

`output{

`elasticsearch { hosts =\> ["localhost:9200"] }

`index =\> "indexforlogstash"

`}

the issue is on command prompt I'm running logstash -f C:\path\logstash.conf  
but I get the following error.  
"Using bundled JDK: ""  
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.  
ERROR: Unknown command 'Search\logstash-7.12.1\bin\logstash.conf'

See: 'bin/logstash --help'  
[FATAL] 2021-05-21 14:12:58.338 [main] 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 C\_3a\_.Elastic\_20\_Search.logstash\_minus\_7\_dot\_12\_dot\_1.vendor.bundle.jruby.$2\_dot\_5\_dot\_0.gems.clamp\_minus\_0\_dot\_6\_dot\_5.lib.clamp.command.run(C:/Elastic Search/logstash-7.12.1/vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/command.rb:137) ~[?:?]  
at C\_3a\_.Elastic\_20\_Search.logstash\_minus\_7\_dot\_12\_dot\_1.lib.bootstrap.environment.(C:\Elastic Search\logstash-7.12.1\lib\bootstrap\environment.rb:88) ~[?:?]

is it not finding my conf file? do I need a different version of Java?  
Any help would be appreciated. Thanks

---

<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: [May 21, 2021, 10:02pm UTC](https://discuss.elastic.co/t/logstash-conf-file-help/273705/2 "2021-05-21T22:02:13Z")

</div>

Is there a space in the path portion of the filename?

---

<div class="post-metadata">

### Author: ![jasieltego](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasieltego/32/77950_2.png) [@jasieltego](https://discuss.elastic.co/u/jasieltego)
#### Post date: [May 21, 2021, 10:09pm UTC](https://discuss.elastic.co/t/logstash-conf-file-help/273705/3 "2021-05-21T22:09:34Z")

</div>

Hi Badger,

Yes, there is a space in the path portion of the filename.

---

<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: [May 21, 2021, 10:17pm UTC](https://discuss.elastic.co/t/logstash-conf-file-help/273705/4 "2021-05-21T22:17:56Z")

</div>

Then you need quotes around the entire filename

```
logstash -f "/Program Files.../bin/logstash.conf"
```

---

<div class="post-metadata">

### Author: ![jasieltego](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasieltego/32/77950_2.png) [@jasieltego](https://discuss.elastic.co/u/jasieltego)
#### Post date: [May 21, 2021, 10:26pm UTC](https://discuss.elastic.co/t/logstash-conf-file-help/273705/5 "2021-05-21T22:26:31Z")

</div>

Thank You Badger, that let me proceed. Unfortunately, I still run into another error.

```auto
C:\Elastic Search\logstash-7.12.1\bin>logstash -f "C:\Elastic Search\logstash-7.12.1\bin\logstash.conf"
"Using bundled JDK: ""
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
Sending Logstash logs to C:/Elastic Search/logstash-7.12.1/logs which is now configured via log4j2.properties
[2021-05-21T15:23:16,109][INFO][logstash.runner] Log4j configuration path used is: C:\Elastic Search\logstash-7.12.1\config\log4j2.properties
[2021-05-21T15:23:16,120][INFO][logstash.runner] Starting Logstash {"logstash.version"=>"7.12.1", "jruby.version"=>"jruby 9.2.13.0 (2.5.7) 2020-08-03 9a89c94bcc OpenJDK 64-Bit Server VM 11.0.10+9 on 11.0.10+9 +indy +jit [mswin32-x86_64]"}
[2021-05-21T15:23:16,217][WARN][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2021-05-21T15:23:17,018][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=>9600}
[2021-05-21T15:23:17,162][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 7, column 7 (byte 87) after output{\r\nelasticsearch { hosts => [\"localhost:9200\"] }\r\nindex ", :backtrace=>["C:/Elastic Search/logstash-7.12.1/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'", "C:/Elastic Search/logstash-7.12.1/logstash-core/lib/logstash/java_pipeline.rb:47:in `initialize'", "C:/Elastic Search/logstash-7.12.1/logstash-core/lib/logstash/pipeline_action/create.rb:52:in `execute'", "C:/Elastic Search/logstash-7.12.1/logstash-core/lib/logstash/agent.rb:389:in `block in converge_state'"]}
[2021-05-21T15:23:17,266][INFO][logstash.runner] Logstash shut down.
[2021-05-21T15:23:17,275][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 C_3a_.Elastic_20_Search.logstash_minus_7_dot_12_dot_1.lib.bootstrap.environment.<main>(C:\Elastic Search\logstash-7.12.1\lib\bootstrap\environment.rb:89) ~[?:?]``

```

---

<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: [May 21, 2021, 10:32pm UTC](https://discuss.elastic.co/t/logstash-conf-file-help/273705/6 "2021-05-21T22:32:52Z")

</div>

> [@jasieltego](#):
>
> `:message=>"Expected one of [\\t\\r\\n], \"#\", \"{\" at line 7, column 7 (byte 87) after output{\r\nelasticsearch { hosts => [\"localhost:9200\"] }\r\nindex ", `

```
output{
elasticsearch { hosts => [\"localhost:9200\"] }
index

```

The } at the end of the elasticsearch line ends the configuration of elasticsearch. You will need to move it further down your configuration. It should be

```
output{
    elasticsearch { 
        hosts => ["localhost:9200"] 
        index => "indexforlogstash"
    }
}

```

---

<div class="post-metadata">

### Author: ![jasieltego](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasieltego/32/77950_2.png) [@jasieltego](https://discuss.elastic.co/u/jasieltego)
#### Post date: [May 22, 2021, 1:19am UTC](https://discuss.elastic.co/t/logstash-conf-file-help/273705/7 "2021-05-22T01:19:43Z")

</div>

Thank you, that worked.

---

<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: [June 19, 2021, 1:20am UTC](https://discuss.elastic.co/t/logstash-conf-file-help/273705/8 "2021-06-19T01:20:16Z")

</div>

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