# Automatic restart of logstash

**URL:** <https://discuss.elastic.co/t/automatic-restart-of-logstash/273860>\
**Category:** Logstash\
**Created:** [May 24, 2021, 7:12pm UTC](https://discuss.elastic.co/t/automatic-restart-of-logstash/273860 "2021-05-24T19:12:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Falikou1](https://avatars.discourse-cdn.com/v4/letter/f/74df32/32.png) [@Falikou1](https://discuss.elastic.co/u/Falikou1)\
**Post date:** [May 24, 2021, 7:12pm UTC](https://discuss.elastic.co/t/automatic-restart-of-logstash/273860/1 "2021-05-24T19:12:20Z")

</div>

I would like the logstash service to restart automatically every Tuesday at 8:00 p.m.  
What type of configuration can you offer me?

---

<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, 7:15pm UTC](https://discuss.elastic.co/t/automatic-restart-of-logstash/273860/2 "2021-05-24T19:15:45Z")

</div>

You would have to do this externally to the service. Every service manager I am familiar with allows services to be stopped and started using the command line. Just put a stop and start in a script and then schedule that.

---

<div class="post-metadata">

**Author:** ![Falikou1](https://avatars.discourse-cdn.com/v4/letter/f/74df32/32.png) [@Falikou1](https://discuss.elastic.co/u/Falikou1)\
**Post date:** [May 24, 2021, 7:19pm UTC](https://discuss.elastic.co/t/automatic-restart-of-logstash/273860/3 "2021-05-24T19:19:05Z")

</div>

> [@Badger](#):
>
> You would have to do this externally to the service. Every service manager I am familiar with allows services to be stopped and started using the command line. Just put a stop and start in a script and then schedule that.

okay  
Can you help me with a sample configuration?

---

<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, 7:39pm UTC](https://discuss.elastic.co/t/automatic-restart-of-logstash/273860/4 "2021-05-24T19:39:25Z")

</div>

I have no idea what scheduler or service manager you are using, so no, I cannot.

---

<div class="post-metadata">

**Author:** ![Falikou1](https://avatars.discourse-cdn.com/v4/letter/f/74df32/32.png) [@Falikou1](https://discuss.elastic.co/u/Falikou1)\
**Post date:** [May 24, 2021, 7:56pm UTC](https://discuss.elastic.co/t/automatic-restart-of-logstash/273860/5 "2021-05-24T19:56:09Z")

</div>

> [@Badger](#):
>
> I have no idea what scheduler or service manager you are using, so no, I cannot.

Using a crontab for example

---

<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, 8:45pm UTC](https://discuss.elastic.co/t/automatic-restart-of-logstash/273860/6 "2021-05-24T20:45:10Z")

</div>

That would be something like

```
0 19 * * 2 systemctl restart logstash

```

in root's crontab.

---

<div class="post-metadata">

**Author:** ![Falikou1](https://avatars.discourse-cdn.com/v4/letter/f/74df32/32.png) [@Falikou1](https://discuss.elastic.co/u/Falikou1)\
**Post date:** [May 24, 2021, 9:00pm UTC](https://discuss.elastic.co/t/automatic-restart-of-logstash/273860/7 "2021-05-24T21:00:31Z")

</div>

> [@Badger](#):
>
> That would be something like

Thank you Badger.  
I will try this.

---

<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 21, 2021, 9:00pm UTC](https://discuss.elastic.co/t/automatic-restart-of-logstash/273860/8 "2021-06-21T21:00:45Z")

</div>

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