# How to handle multiple app logs using single log-stash instance

**URL:** <https://discuss.elastic.co/t/how-to-handle-multiple-app-logs-using-single-log-stash-instance/37472>\
**Category:** Logstash\
**Created:** [December 17, 2015, 1:16pm UTC](https://discuss.elastic.co/t/how-to-handle-multiple-app-logs-using-single-log-stash-instance/37472 "2015-12-17T13:16:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sampath\_methuku](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@sampath\_methuku](https://discuss.elastic.co/u/sampath_methuku)\
**Post date:** [December 17, 2015, 1:16pm UTC](https://discuss.elastic.co/t/how-to-handle-multiple-app-logs-using-single-log-stash-instance/37472/1 "2015-12-17T13:16:29Z")

</div>

we have 5 types apps which generates log in different format , and I want to store these 5 apps logs in 5 different indexes , but I want to use only single log-stash instance .

to differentiate the input at logstash level we can use beats port no example I will use  
5001 for app1  
5002 for app2  
5003 for app3

but I want to apply filter based on message is coming from which app , i.e i have 5 different filters  
if message comes form app1 or port 5001 I want to apply filter filter-1 , and output to index-1 in elastic search  
if message comes from app2 or port 5002 I want to apply filter filter-2 , and output to index-2 in elastic search

how to apply different filters based on input and output to different index based on 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:** [December 17, 2015, 3:37pm UTC](https://discuss.elastic.co/t/how-to-handle-multiple-app-logs-using-single-log-stash-instance/37472/2 "2015-12-17T15:37:03Z")

</div>

Please see this part of the documentation: [https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html](https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html)

---

<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:** [July 6, 2017, 5:17am UTC](https://discuss.elastic.co/t/how-to-handle-multiple-app-logs-using-single-log-stash-instance/37472/3 "2017-07-06T05:17:59Z")

</div>


