# Logstash cli with file option issue

**URL:** https://discuss.elastic.co/t/logstash-cli-with-file-option-issue/314349
**Category:** Logstash
**Tags:** docker
**Created:** [September 13, 2022, 11:37pm UTC](https://discuss.elastic.co/t/logstash-cli-with-file-option-issue/314349 "2022-09-13T23:37:43Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![karlkras](https://avatars.discourse-cdn.com/v4/letter/k/b19c9b/32.png) [@karlkras](https://discuss.elastic.co/u/karlkras)
#### Post date: [September 13, 2022, 11:37pm UTC](https://discuss.elastic.co/t/logstash-cli-with-file-option-issue/314349/1 "2022-09-13T23:37:43Z")

</div>

- Windows 10
- Logstash for Windows 8.4.1

Good afternoon.  
I've been working through some courseware on using logstash and have run into a problem while attempting to use the -f option with the logstash.bat file.  
The file to the config file, e.g.,:

`> logstash -f .\myconfigs\pipeline.conf`

is not working... it's appending the file name fragment to the logstash directory and is complaining since it can't find it here. Well yeah, no kidding... what shows up in the error:

```auto
[2022-09-13T16:20:02,433][WARN][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2022-09-13T16:20:04,636][INFO][logstash.config.source.local.configpathloader] No config files found in path {:path=>"c:/logstash-8.4.1/myconfigs/pipeline/pipeline.conf"}

```

I've also attempted changing slashes in the reference to forward slashes, and same result.

The only work around I've found for this is entering the fully qualified path for the -f value. Not ideal.

---

<div class="post-metadata">

### Author: ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)
#### Post date: [September 14, 2022, 8:12am UTC](https://discuss.elastic.co/t/logstash-cli-with-file-option-issue/314349/2 "2022-09-14T08:12:28Z")

</div>

Please add --path.settings  
`logstash.bat -f c:\logstash-8.4.1\myconfigs\pipeline.conf --path.settings c:\logstash-8.4.1\config\`  
or if you running from bin, then relative path should be:  
`logstash.bat -f ..\myconfigs\pipeline.conf --path.settings ..\config\`

---

<div class="post-metadata">

### Author: ![karlkras](https://avatars.discourse-cdn.com/v4/letter/k/b19c9b/32.png) [@karlkras](https://discuss.elastic.co/u/karlkras)
#### Post date: [September 14, 2022, 9:45am UTC](https://discuss.elastic.co/t/logstash-cli-with-file-option-issue/314349/3 "2022-09-14T09:45:22Z")

</div>

Maybe I wasn't clear. I have the logstash bin in my path environment, so I can run `logstash.bat` from anywhere.  
Now let's say my conf file is here:  
`c:\work\mylogstashstuff\pipelines\pipeline.conf`

Now if I'm in my cmd console and my current location is:  
`c:\work\mylogstashstuff`  
And attempt to run:  
`logstash -f .\pipelines\pipeline.conf`

I get the error that I mentioned in the original question.  
I don't see where your recommended solution would apply here?  
Thanks!

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [September 14, 2022, 12:36pm UTC](https://discuss.elastic.co/t/logstash-cli-with-file-option-issue/314349/4 "2022-09-14T12:36:04Z")

</div>

The `path.settings` is not related to the bin, it is related to the Logstash configurations.

Have you tried using `--path.settings` ?

Also, are you using the old Command prompt or a Powershell session?

---

<div class="post-metadata">

### Author: ![karlkras](https://avatars.discourse-cdn.com/v4/letter/k/b19c9b/32.png) [@karlkras](https://discuss.elastic.co/u/karlkras)
#### Post date: [September 14, 2022, 6:24pm UTC](https://discuss.elastic.co/t/logstash-cli-with-file-option-issue/314349/5 "2022-09-14T18:24:31Z")

</div>

I've tried from both a basic (old?) cmd console and git bash shell (but gave up on this since this probably adds Linux path format logic that wouldn't be recognized by the windows version of the distribution).  
Frankly I'm not understanding how this  
`--path.settings`  
option is supposed to work from the above example.

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [September 14, 2022, 6:43pm UTC](https://discuss.elastic.co/t/logstash-cli-with-file-option-issue/314349/6 "2022-09-14T18:43:51Z")

</div>

The `path.settings` is the path were logstash config is, the `logstash.yml` and `jvm.options` file, it may have not influence in anything in your issue, but it is worth to try.

Also, try to run in Powershell, it is how the example in [the documentation works](https://www.elastic.co/guide/en/logstash/current/running-logstash-windows.html#running-logstash-windows-manual).

---

<div class="post-metadata">

### Author: ![karlkras](https://avatars.discourse-cdn.com/v4/letter/k/b19c9b/32.png) [@karlkras](https://discuss.elastic.co/u/karlkras)
#### Post date: [September 14, 2022, 11:05pm UTC](https://discuss.elastic.co/t/logstash-cli-with-file-option-issue/314349/7 "2022-09-14T23:05:43Z")

</div>

Hi Leandro,  
No, same problem in powershell. However...  
I was attempting to run `logstash.bat` via being in my path settings in my environment.  
If I run it explicitly from the bin of logstash:

```auto
PS C:\logstash-8.4.1\bin> .\logstash.bat -f ..\..\Users\me\work\logstash\config\pipeline\pipeline.conf

```

it works... but that's kind of funky.

thanks for your feedback.

---

<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: [October 12, 2022, 11:05pm UTC](https://discuss.elastic.co/t/logstash-cli-with-file-option-issue/314349/8 "2022-10-12T23:05:51Z")

</div>

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