# Automatically start Logstash when Windows reboot

**URL:** <https://discuss.elastic.co/t/automatically-start-logstash-when-windows-reboot/273839>\
**Category:** Logstash\
**Created:** [May 24, 2021, 2:34pm UTC](https://discuss.elastic.co/t/automatically-start-logstash-when-windows-reboot/273839 "2021-05-24T14:34:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![usman1](https://avatars.discourse-cdn.com/v4/letter/u/c67d28/32.png) [@usman1](https://discuss.elastic.co/u/usman1)\
**Post date:** [May 24, 2021, 2:34pm UTC](https://discuss.elastic.co/t/automatically-start-logstash-when-windows-reboot/273839/1 "2021-05-24T14:34:29Z")

</div>

I am using Windows OS as a source in which Logstash is installed and run Logstash using the following command on PowerShell:  
`logstash -f logstash.conf`

Now as I am working in an industrial setting, manually running this command after every reboot is not feasible and I want to configure it in such a way that whenever system reboots, Logstash runs automatically.

Please suggest me a way to do this.

---

<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:** [May 24, 2021, 3:07pm UTC](https://discuss.elastic.co/t/automatically-start-logstash-when-windows-reboot/273839/2 "2021-05-24T15:07:05Z")

</div>

> [@usman1](#):
>
> Please suggest me a way to do this.

[Run it as a service](https://www.elastic.co/guide/en/logstash/current/running-logstash-windows.html#running-logstash-windows-nssm).

---

<div class="post-metadata">

**Author:** ![usman1](https://avatars.discourse-cdn.com/v4/letter/u/c67d28/32.png) [@usman1](https://discuss.elastic.co/u/usman1)\
**Post date:** [May 25, 2021, 3:50pm UTC](https://discuss.elastic.co/t/automatically-start-logstash-when-windows-reboot/273839/3 "2021-05-25T15:50:37Z")

</div>

@Badger It surely works, but if we want to monitor its status after running it as a service, what is the best way to do that?

We can see by `Get-Service -Name logstash` but any other way to see if Logstash is running by using Logs etc?

---

<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:** [May 25, 2021, 4:12pm UTC](https://discuss.elastic.co/t/automatically-start-logstash-when-windows-reboot/273839/4 "2021-05-25T16:12:37Z")

</div>

If you have x-pack you can use that to [monitor](https://www.elastic.co/guide/en/logstash/current/configuring-logstash.html) logstash.

---

<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:** [June 22, 2021, 4:13pm UTC](https://discuss.elastic.co/t/automatically-start-logstash-when-windows-reboot/273839/5 "2021-06-22T16:13:09Z")

</div>

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