# Logstash 2.1 : Multiple Instances per Host

**URL:** <https://discuss.elastic.co/t/logstash-2-1-multiple-instances-per-host/35548>\
**Category:** Logstash\
**Created:** [November 25, 2015, 12:19pm UTC](https://discuss.elastic.co/t/logstash-2-1-multiple-instances-per-host/35548 "2015-11-25T12:19:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dawiro](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dawiro](https://discuss.elastic.co/u/dawiro)\
**Post date:** [November 25, 2015, 12:19pm UTC](https://discuss.elastic.co/t/logstash-2-1-multiple-instances-per-host/35548/1 "2015-11-25T12:19:26Z")

</div>

Hi,  
I am trying to set up multiple logstash instances running on one host. I'm doing this by modifying the $name variable in the init script and modifying logfile output names and path to config etc. This works fine except that the logfile name and path seems to be hard coded somewhere such that the value set in the init script is ignored.

I assume this is set somewhere under /opt/logstash. Could someone point me to this setting so I can avoid multiple instances writing to s single file?

Regards,  
David

---

<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:** [November 25, 2015, 1:17pm UTC](https://discuss.elastic.co/t/logstash-2-1-multiple-instances-per-host/35548/2 "2015-11-25T13:17:50Z")

</div>

You're setting $NAME (not $name), right? That's what goes into $LS\_LOG\_DIR.

---

<div class="post-metadata">

**Author:** ![dawiro](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dawiro](https://discuss.elastic.co/u/dawiro)\
**Post date:** [November 25, 2015, 1:28pm UTC](https://discuss.elastic.co/t/logstash-2-1-multiple-instances-per-host/35548/3 "2015-11-25T13:28:50Z")

</div>

The variable defined in the init script is $name. Regardless of what LS\_LOG\_DIR is set to the log directory path stays fixed, as does the log file name...

---

<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:** [November 25, 2015, 1:32pm UTC](https://discuss.elastic.co/t/logstash-2-1-multiple-instances-per-host/35548/4 "2015-11-25T13:32:50Z")

</div>

> The variable defined in the init script is $name.

Ah, right. I was looking in [logstash.sys.debian](https://github.com/elastic/logstash/blob/v2.1.0/pkg/logstash.sysv.debian) where the variable is named $NAME while it indeed is $name in [logstash.sysv](https://github.com/elastic/logstash/blob/v2.1.0/pkg/logstash.sysv).

> Regardless of what LS\_LOG\_DIR is set to the log directory path stays fixed, as does the log file name...

What does your Logstash command line look like (`ps aux | grep logstash` should do)?

---

<div class="post-metadata">

**Author:** ![dawiro](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dawiro](https://discuss.elastic.co/u/dawiro)\
**Post date:** [November 25, 2015, 2:03pm UTC](https://discuss.elastic.co/t/logstash-2-1-multiple-instances-per-host/35548/5 "2015-11-25T14:03:52Z")

</div>

Hi,  
I've sorted it out. Those settings were being overridden by the defaults file under /etc/default.

Regards,  
David

---

<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:21am UTC](https://discuss.elastic.co/t/logstash-2-1-multiple-instances-per-host/35548/6 "2017-07-06T05:21:15Z")

</div>


