# Error when using separate config files

**URL:** <https://discuss.elastic.co/t/error-when-using-separate-config-files/82874>\
**Category:** Logstash\
**Created:** [April 19, 2017, 11:26am UTC](https://discuss.elastic.co/t/error-when-using-separate-config-files/82874 "2017-04-19T11:26:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dreadlocked1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dreadlocked1/32/22072_2.png) [@dreadlocked1](https://discuss.elastic.co/u/dreadlocked1)\
**Post date:** [April 19, 2017, 11:26am UTC](https://discuss.elastic.co/t/error-when-using-separate-config-files/82874/1 "2017-04-19T11:26:40Z")

</div>

Hi, I'm using the following command line to execute logstash with multiple config files:

`$ /usr/share/logstash/bin/logstash -f /etc/logstash/conf.d/{1_inputs.conf,2_filters.conf,3_outputs.conf} --path.settings /etc/logstash`

I've tried too

`$ /usr/share/logstash/bin/logstash -f /etc/logstash/conf.d/*.conf --path.settings /etc/logstash`

And always getting the following error:

`ERROR: Unknown command '/etc/logstash/conf.d/2_filters.conf'`

The config files content is:

- input.conf

> input {  
> ....  
> }

- filters.conf

> filter{  
> ....  
> }

- outputs.conf

> output {  
> ...  
> }

What's happening here? (I'm using Logstash 5.3.0)

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [April 20, 2017, 5:16am UTC](https://discuss.elastic.co/t/error-when-using-separate-config-files/82874/2 "2017-04-20T05:16:01Z")

</div>

Your command is expanded by the shell like this:

```
/usr/share/logstash/bin/logstash -f A B C --path.settings /etc/logstash

```

Since files B and C aren't preceded by `-f` Logstash is rightfully complaining.

Instead, put all files in a directory and pass that directory via `-f`.

---

<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:** [May 18, 2017, 5:21am UTC](https://discuss.elastic.co/t/error-when-using-separate-config-files/82874/3 "2017-05-18T05:21:18Z")

</div>

Closed on May 18, 2017, 5:21am UTC

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