# How to run multiple configuration file as a service

**URL:** <https://discuss.elastic.co/t/how-to-run-multiple-configuration-file-as-a-service/99331>\
**Category:** Logstash\
**Created:** [September 4, 2017, 4:25pm UTC](https://discuss.elastic.co/t/how-to-run-multiple-configuration-file-as-a-service/99331 "2017-09-04T16:25:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinay\_garg](https://avatars.discourse-cdn.com/v4/letter/v/8dc957/32.png) [@vinay\_garg](https://discuss.elastic.co/u/vinay_garg)\
**Post date:** [September 4, 2017, 4:25pm UTC](https://discuss.elastic.co/t/how-to-run-multiple-configuration-file-as-a-service/99331/1 "2017-09-04T16:25:51Z")

</div>

Hi All,

I'm using Logstash 5.5.2. I have installed logstash using rpm.

I'm trying to run multiple conf file logstash-a.conf, logstash-b.conf, logstash-c.conf parallely in logstash as a service. I have kept all conf file in /etc/logstash/conf.d/.

cat lostash-a.conf  
input{  
beats{  
hosts =\> "0.0.0.0",  
port =\> 5044  
}  
}  
output {  
elasticsearch {  
hosts =\> ["[http://localhost:9200](http://localhost:9200)"]  
index =\> "a-%{+YYYY.MM.dd}"  
}  
}  
All the configuration are same except beat port and index name. beat port and Index name is different in all conf file.

When i've started service, only one conf file is executed at once time. I'm not able to run all conf file parallel.

Can anyone suggest how can i run?  
I'll be very thankful to you.

---

<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:** [September 5, 2017, 5:52am UTC](https://discuss.elastic.co/t/how-to-run-multiple-configuration-file-as-a-service/99331/2 "2017-09-05T05:52:44Z")

</div>

> When i’ve started service, only one conf file is executed at once time.

Exactly what do you mean by that?

> I’m not able to run all conf file parallel.

What's in the rest of the files?

Please be aware that Logstash has a single event pipeline. Unless you use conditionals all events from all inputs in all configuration files will be processed by all filters in all configuration files and then sent to all outputs in all configuration files.

---

<div class="post-metadata">

**Author:** ![vinay\_garg](https://avatars.discourse-cdn.com/v4/letter/v/8dc957/32.png) [@vinay\_garg](https://discuss.elastic.co/u/vinay_garg)\
**Post date:** [September 5, 2017, 6:03am UTC](https://discuss.elastic.co/t/how-to-run-multiple-configuration-file-as-a-service/99331/3 "2017-09-05T06:03:00Z")

</div>

I have also used condition by using (tags =\> "name") in input and (if "name" in [tags]) in filter & output, but all the index data got mixed.  
Can you give me some example how can i use multiple input beat file with different port and output index will be differ for each conf file in single logstash?

---

<div class="post-metadata">

**Author:** ![vinay\_garg](https://avatars.discourse-cdn.com/v4/letter/v/8dc957/32.png) [@vinay\_garg](https://discuss.elastic.co/u/vinay_garg)\
**Post date:** [September 5, 2017, 7:47am UTC](https://discuss.elastic.co/t/how-to-run-multiple-configuration-file-as-a-service/99331/4 "2017-09-05T07:47:00Z")

</div>

Hi,

Thanks for your response.

I've resolve the issue.  
In the each filebeat file, i have define document\_type = "firstfile"

In the logstash file, i have define type = "firstfile" with each beat input and apply condition if else in fiter & output.

---

<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 3, 2017, 7:47am UTC](https://discuss.elastic.co/t/how-to-run-multiple-configuration-file-as-a-service/99331/5 "2017-10-03T07:47:06Z")

</div>

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