# Tried to pass multiple conf file not working

**URL:** <https://discuss.elastic.co/t/tried-to-pass-multiple-conf-file-not-working/138287>\
**Category:** Logstash\
**Created:** [July 2, 2018, 11:09pm UTC](https://discuss.elastic.co/t/tried-to-pass-multiple-conf-file-not-working/138287 "2018-07-02T23:09:23Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Krishna2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/krishna2/32/20893_2.png) [@Krishna2](https://discuss.elastic.co/u/Krishna2)\
**Post date:** [July 2, 2018, 11:09pm UTC](https://discuss.elastic.co/t/tried-to-pass-multiple-conf-file-not-working/138287/1 "2018-07-02T23:09:23Z")

</div>

I. had passed as below to Logstash. It is not taking.

## I. have to pass multiple input files. to Logstash , so I had created multiple conf files as below -------I. passed like below bin/logstash -f logstash-filter\*.conf

bin/logstash -f logstash-filter10.conf -f logstash-filter11.conf. -f logstash-filter12.conf. -f logstash-filter13.conf  
----------------logstash-filter\*.conf like below  
input {

file {  
path =\> "/Users/krishna/Elastic-kibana-logstash/logstash-6.3.0/input/Autosys-Logs.txt"  
start\_position =\> "beginning"  
type =\> "apache"  
}

}

output {  
elasticsearch { hosts =\> ["localhost:9200"]  
index =\> "elasticlog-demo"  
}  
stdout { codec =\> rubydebug }  
}  
.

---

<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:** [July 3, 2018, 5:59am UTC](https://discuss.elastic.co/t/tried-to-pass-multiple-conf-file-not-working/138287/2 "2018-07-03T05:59:26Z")

</div>

If you have multiple config files put them in a directory and pass the path to that directory via `-f`.

---

<div class="post-metadata">

**Author:** ![Krishna2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/krishna2/32/20893_2.png) [@Krishna2](https://discuss.elastic.co/u/Krishna2)\
**Post date:** [July 3, 2018, 10:40pm UTC](https://discuss.elastic.co/t/tried-to-pass-multiple-conf-file-not-working/138287/3 "2018-07-03T22:40:27Z")

</div>

I had tried. as below by putting multiple config files in folder and passing folder with -f option. It throws error.  
----------I passed like this  
bin/logstash -f fileconfig

[2018-07-03T15:38:42,953][ERROR][logstash.agent] Failed to execute action {:action=\>LogStash::PipelineAction::Create/pipeline\_id:main, :exception=\>"LogStash::ConfigurationError", :message=\>"Expected one of #, input, filter, output at line 33, column 1 (byte 688) after ", :backtrace=\>["/Users/krishna/Elastic-kibana-logstash/logsta

---

<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:** [July 4, 2018, 9:53am UTC](https://discuss.elastic.co/t/tried-to-pass-multiple-conf-file-not-working/138287/4 "2018-07-04T09:53:38Z")

</div>

That indicates that one or more files in the directory is invalid.

---

<div class="post-metadata">

**Author:** ![Krishna2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/krishna2/32/20893_2.png) [@Krishna2](https://discuss.elastic.co/u/Krishna2)\
**Post date:** [July 5, 2018, 11:09pm UTC](https://discuss.elastic.co/t/tried-to-pass-multiple-conf-file-not-working/138287/5 "2018-07-05T23:09:46Z")

</div>

my two files in the folder are as below  
input {

```
  file {
      path => "/Users/krishna/Elastic-kibana-logstash/logstash-6.3.0/input/Storm_supervisor-Logs.csv"
      start_position => "beginning"
      type => "apache"
   }

```

}  
filter {

```
  grok {
        match => {
                  "message" => "%{WORD:ERROR} "
                }
      }

   }

```

output {  
elasticsearch { hosts =\> ["localhost:9200"]  
index =\> "elasticlog-demo"  
}  
stdout { codec =\> rubydebug }  
}  
--------another file  
nput {  
file {  
path =\> "/Users/krishna/Elastic-kibana-logstash/logstash-6.3.0/input/ETL-Logs.txt"  
start\_position =\> "begining"  
type =\> "apache"  
}  
}  
}

output {  
elasticsearch { hosts =\> ["localhost:9200"]  
index =\> "elasticlog-demo"  
}  
stdout { codec =\> rubydebug }  
}

---

<div class="post-metadata">

**Author:** ![Krishna2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/krishna2/32/20893_2.png) [@Krishna2](https://discuss.elastic.co/u/Krishna2)\
**Post date:** [July 5, 2018, 11:11pm UTC](https://discuss.elastic.co/t/tried-to-pass-multiple-conf-file-not-working/138287/6 "2018-07-05T23:11:56Z")

</div>

I had shown my conf files in folder. Is there a way to put two input csv files in a single .conf file ? I could not do so. So I put two .conf files in folder and passed folder nam as input

---

<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:** [July 6, 2018, 7:00am UTC](https://discuss.elastic.co/t/tried-to-pass-multiple-conf-file-not-working/138287/7 "2018-07-06T07:00:58Z")

</div>

Logstash merges all configuration files found in a directory. It doesn't matter if you have all your inputs, filters, and output in a single file or if you split them in multiple files.

In your case, keep in mind that you have to elasticsearch outputs so you'll send all documents to ES twice.

---

<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:** [August 3, 2018, 7:00am UTC](https://discuss.elastic.co/t/tried-to-pass-multiple-conf-file-not-working/138287/8 "2018-08-03T07:00:58Z")

</div>

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