# Logstash: Logevent when shutting down but not when starting up

**URL:** <https://discuss.elastic.co/t/logstash-logevent-when-shutting-down-but-not-when-starting-up/333146>\
**Category:** Logstash\
**Created:** [May 11, 2023, 4:29am UTC](https://discuss.elastic.co/t/logstash-logevent-when-shutting-down-but-not-when-starting-up/333146 "2023-05-11T04:29:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bitnapper](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bitnapper/32/96566_2.png) [@bitnapper](https://discuss.elastic.co/u/bitnapper)\
**Post date:** [May 11, 2023, 4:29am UTC](https://discuss.elastic.co/t/logstash-logevent-when-shutting-down-but-not-when-starting-up/333146/1 "2023-05-11T04:29:53Z")

</div>

Hi, simple question. Logstash produces a log-event when shutting down but not when starting up. Can I make it do that without activating the whol debug log?

Regards

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [May 11, 2023, 6:24am UTC](https://discuss.elastic.co/t/logstash-logevent-when-shutting-down-but-not-when-starting-up/333146/2 "2023-05-11T06:24:06Z")

</div>

It depends what you want to get, `config.debug: true` and `journalctl --unit logstash` might be useful. Check [the documentation](https://www.elastic.co/guide/en/logstash/current/logging.html), [log4j2 has own configuration](https://logging.apache.org/log4j/2.x/manual/configuration.html#Loggers).

---

<div class="post-metadata">

**Author:** ![bitnapper](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bitnapper/32/96566_2.png) [@bitnapper](https://discuss.elastic.co/u/bitnapper)\
**Post date:** [May 12, 2023, 7:16am UTC](https://discuss.elastic.co/t/logstash-logevent-when-shutting-down-but-not-when-starting-up/333146/3 "2023-05-12T07:16:20Z")

</div>

Well, when its stopping it create one entry that its stopping. So when its starting, I want it just tell me it has started.

---

<div class="post-metadata">

**Author:** ![Anton\_H](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anton_h/32/10200_2.png) [@Anton\_H](https://discuss.elastic.co/u/Anton_H)\
**Post date:** [May 12, 2023, 8:13am UTC](https://discuss.elastic.co/t/logstash-logevent-when-shutting-down-but-not-when-starting-up/333146/4 "2023-05-12T08:13:53Z")

</div>

Maybe you could use metricbeat to monitor the process?

---

<div class="post-metadata">

**Author:** ![bitnapper](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bitnapper/32/96566_2.png) [@bitnapper](https://discuss.elastic.co/u/bitnapper)\
**Post date:** [May 14, 2023, 10:25am UTC](https://discuss.elastic.co/t/logstash-logevent-when-shutting-down-but-not-when-starting-up/333146/5 "2023-05-14T10:25:38Z")

</div>

Yes, I could install another service to watch over that one starting and stopping. I Also can shoot me in the foot. I'm wondering about the consistency of Logstash. If it writs one line in its logs when it receives a shutdown signal, why not do the same when its starts? I thought when I use its logs to see if its working properly I could also see if it comes back up again after it stops for any reason. But when its not possible to have consistent logs from a tool made for logs, I'll use the windows process logs.

---

<div class="post-metadata">

**Author:** ![Anton\_H](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anton_h/32/10200_2.png) [@Anton\_H](https://discuss.elastic.co/u/Anton_H)\
**Post date:** [May 14, 2023, 10:54am UTC](https://discuss.elastic.co/t/logstash-logevent-when-shutting-down-but-not-when-starting-up/333146/6 "2023-05-14T10:54:50Z")

</div>

Ok, I can understand that. On the other hand the process Logstash does not exist yet when it receives a start request, so it cannot write anything to its logs about it.  
Logstash does write a line that it is starting. And you could monitor the logstash logs for the line starting with `[<timestamp>][INFO] [logstash.agent] Pipelines running {:count=>`  
Additional you could monitor the same line for the last bit, because it ends with `:non_running_pipelines=>[]}` if everything has started up fine, for as far as I know.

You could use Logstash to fetch and parse the Logstash logs, but that would not help you when Logstash crashes and does not start correctly.....

---

<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 11, 2023, 10:55am UTC](https://discuss.elastic.co/t/logstash-logevent-when-shutting-down-but-not-when-starting-up/333146/7 "2023-06-11T10:55:12Z")

</div>

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