# How do I configure logstash for an Ubuntu service?

**URL:** <https://discuss.elastic.co/t/how-do-i-configure-logstash-for-an-ubuntu-service/195518>\
**Category:** Logstash\
**Created:** [August 16, 2019, 3:26pm UTC](https://discuss.elastic.co/t/how-do-i-configure-logstash-for-an-ubuntu-service/195518 "2019-08-16T15:26:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhare](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mhare/32/52213_2.png) [@mhare](https://discuss.elastic.co/u/mhare)\
**Post date:** [August 16, 2019, 3:26pm UTC](https://discuss.elastic.co/t/how-do-i-configure-logstash-for-an-ubuntu-service/195518/1 "2019-08-16T15:26:18Z")

</div>

Specifically, when I was running logstash as a process I ran it like:

bin/logstash -f logstash-simple.conf

But I have stopped that madness and want to run it as a service  
I have the service installed from the debian package, but how do I tell logstash to used the pipeline I have defined in logstash-simple.conf?

Thanks

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [August 16, 2019, 3:32pm UTC](https://discuss.elastic.co/t/how-do-i-configure-logstash-for-an-ubuntu-service/195518/2 "2019-08-16T15:32:04Z")

</div>

You could set path.config in logstash.yml, or use pipelines.yml

---

<div class="post-metadata">

**Author:** ![mhare](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mhare/32/52213_2.png) [@mhare](https://discuss.elastic.co/u/mhare)\
**Post date:** [August 16, 2019, 3:37pm UTC](https://discuss.elastic.co/t/how-do-i-configure-logstash-for-an-ubuntu-service/195518/3 "2019-08-16T15:37:30Z")

</div>

Can I put a single pipeline in pipelines.yml?  
I tried it a while back and it complained about needing an array

---

<div class="post-metadata">

**Author:** ![mhare](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mhare/32/52213_2.png) [@mhare](https://discuss.elastic.co/u/mhare)\
**Post date:** [August 16, 2019, 3:42pm UTC](https://discuss.elastic.co/t/how-do-i-configure-logstash-for-an-ubuntu-service/195518/4 "2019-08-16T15:42:55Z")

</div>

So, if I make path.config: /foo/bar/logstash-simple.conf  
and put logstash-simple.conf into /foo/bar  
it should work?  
Is there a best place to put such config files for services?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [August 16, 2019, 4:26pm UTC](https://discuss.elastic.co/t/how-do-i-configure-logstash-for-an-ubuntu-service/195518/5 "2019-08-16T16:26:42Z")

</div>

> [@mhare](#):
>
> Can I put a single pipeline in pipelines.yml?

Absolutely. That is a configuration I use all the time.

I would set path.config to the name of the file, not just the directory that contains it.

---

<div class="post-metadata">

**Author:** ![mhare](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mhare/32/52213_2.png) [@mhare](https://discuss.elastic.co/u/mhare)\
**Post date:** [August 16, 2019, 5:34pm UTC](https://discuss.elastic.co/t/how-do-i-configure-logstash-for-an-ubuntu-service/195518/6 "2019-08-16T17:34:05Z")

</div>

Thanks, I know I'll be adding more pipelines in the future, so that would be helpful to have it there from the start. I did also notice it works better if I specify the full file path and not just the directory.  
Cheers!

---

<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:** [September 13, 2019, 5:34pm UTC](https://discuss.elastic.co/t/how-do-i-configure-logstash-for-an-ubuntu-service/195518/7 "2019-09-13T17:34:07Z")

</div>

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