# Logstash .conf file run forever as a service?

**URL:** <https://discuss.elastic.co/t/logstash-conf-file-run-forever-as-a-service/162952>\
**Category:** Logstash\
**Created:** [January 4, 2019, 12:01pm UTC](https://discuss.elastic.co/t/logstash-conf-file-run-forever-as-a-service/162952 "2019-01-04T12:01:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![inandi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inandi/32/40801_2.png) [@inandi](https://discuss.elastic.co/u/inandi)\
**Post date:** [January 4, 2019, 12:01pm UTC](https://discuss.elastic.co/t/logstash-conf-file-run-forever-as-a-service/162952/1 "2019-01-04T12:01:47Z")

</div>

i want to run logstash.conf file forever in server . Everytime i have to run this command

> sudo /usr/share/logstash/bin/logstash -f /etc/logstash/conf.d/logstash.conf

but i want run some command which will run forever. I got this command but its not working

> nohup /usr/share/logstash/bin/logstash -f /etc/logstash/conf.d/logstash.conf \> /dev/null &

is there any thing wrong ?

---

<div class="post-metadata">

**Author:** ![A\_B](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/a_b/32/17104_2.png) [@A\_B](https://discuss.elastic.co/u/A_B)\
**Post date:** [January 4, 2019, 1:01pm UTC](https://discuss.elastic.co/t/logstash-conf-file-run-forever-as-a-service/162952/2 "2019-01-04T13:01:00Z")

</div>

Hi @inandi,

on which operating system is your Logstash service running? And how is Logstash installed?

---

<div class="post-metadata">

**Author:** ![inandi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inandi/32/40801_2.png) [@inandi](https://discuss.elastic.co/u/inandi)\
**Post date:** [January 4, 2019, 1:22pm UTC](https://discuss.elastic.co/t/logstash-conf-file-run-forever-as-a-service/162952/3 "2019-01-04T13:22:36Z")

</div>

hi @A_B,

it is Ubuntu Server 18.10 and i have followed this commands

> 1. sudo apt-get update
> 2. sudo apt-get install logstash
> 3. sudo systemctl restart logstash

---

<div class="post-metadata">

**Author:** ![A\_B](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/a_b/32/17104_2.png) [@A\_B](https://discuss.elastic.co/u/A_B)\
**Post date:** [January 4, 2019, 1:31pm UTC](https://discuss.elastic.co/t/logstash-conf-file-run-forever-as-a-service/162952/4 "2019-01-04T13:31:47Z")

</div>

Then `sudo systemctl start logstash` will start Logstash as a service (in background = run _forever_) using default config file which _should_ be `/etc/logstash/conf.d/logstash.conf`.

---

<div class="post-metadata">

**Author:** ![inandi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inandi/32/40801_2.png) [@inandi](https://discuss.elastic.co/u/inandi)\
**Post date:** [January 4, 2019, 1:33pm UTC](https://discuss.elastic.co/t/logstash-conf-file-run-forever-as-a-service/162952/5 "2019-01-04T13:33:04Z")

</div>

> [@A\_B](#):
>
> sudo systemctl start logstash

what if i have multiple conf file ?

---

<div class="post-metadata">

**Author:** ![A\_B](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/a_b/32/17104_2.png) [@A\_B](https://discuss.elastic.co/u/A_B)\
**Post date:** [January 4, 2019, 1:38pm UTC](https://discuss.elastic.co/t/logstash-conf-file-run-forever-as-a-service/162952/6 "2019-01-04T13:38:12Z")

</div>

That is another question... Do you really need more than one?

I guess you can create several SystemD unit files that use different config files. That is what I used to do for Elasticsearch.

So far I have been able to get by with just one Logstash config. It is getting a bit long with close to 20 different inputs and plenty of conditionals in the _filter_ section.

Then there are Logstash [_pipelines_](https://www.elastic.co/guide/en/logstash/6.5/multiple-pipelines.html) that might help you.

---

<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:** [February 1, 2019, 1:38pm UTC](https://discuss.elastic.co/t/logstash-conf-file-run-forever-as-a-service/162952/7 "2019-02-01T13:38:18Z")

</div>

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