# Automatically start logstash configuration file

**URL:** <https://discuss.elastic.co/t/automatically-start-logstash-configuration-file/275427>\
**Category:** Logstash\
**Created:** [June 9, 2021, 11:23am UTC](https://discuss.elastic.co/t/automatically-start-logstash-configuration-file/275427 "2021-06-09T11:23:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tarekilani](https://avatars.discourse-cdn.com/v4/letter/t/54ee81/32.png) [@tarekilani](https://discuss.elastic.co/u/tarekilani)\
**Post date:** [June 9, 2021, 11:23am UTC](https://discuss.elastic.co/t/automatically-start-logstash-configuration-file/275427/1 "2021-06-09T11:23:01Z")

</div>

Hello,

Please i would like to know if there is any method to set a logstash.conf file start automatically with the OS.  
I'm currently using a logstash.conf file using this command : # /usr/share/logstash/bin/logstash -f logstash.conf  
But what if the machine suddenly stopped or restarted? do i need to execute this command manually?  
Thank you in advance for your help.

---

<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:** [June 9, 2021, 3:58pm UTC](https://discuss.elastic.co/t/automatically-start-logstash-configuration-file/275427/2 "2021-06-09T15:58:51Z")

</div>

The [documentation](https://www.elastic.co/guide/en/logstash/current/setup-logstash.html) covers running logstash as a service.

---

<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 7, 2021, 3:59pm UTC](https://discuss.elastic.co/t/automatically-start-logstash-configuration-file/275427/3 "2021-07-07T15:59:01Z")

</div>

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