# Powershell the events stats logstash

**URL:** <https://discuss.elastic.co/t/powershell-the-events-stats-logstash/149823>\
**Category:** Logstash\
**Created:** [September 25, 2018, 12:37pm UTC](https://discuss.elastic.co/t/powershell-the-events-stats-logstash/149823 "2018-09-25T12:37:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cowensel](https://avatars.discourse-cdn.com/v4/letter/c/eb9ed0/32.png) [@cowensel](https://discuss.elastic.co/u/cowensel)\
**Post date:** [September 25, 2018, 12:37pm UTC](https://discuss.elastic.co/t/powershell-the-events-stats-logstash/149823/1 "2018-09-25T12:37:49Z")

</div>

I wonder if you can help,

Has anyone build a powershell that connects to the logstash monitoring API to get events in stats and then checks whether the events in is less than what it was x minutes ago and if it is send a email and restart logstash.

The idea is to create an ELK stack that is somewhat foolproof without spending money.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [September 26, 2018, 2:08pm UTC](https://discuss.elastic.co/t/powershell-the-events-stats-logstash/149823/2 "2018-09-26T14:08:26Z")

</div>

You want to restart Logstash just because it's processing fewer events than X minutes ago?

---

<div class="post-metadata">

**Author:** ![cowensel](https://avatars.discourse-cdn.com/v4/letter/c/eb9ed0/32.png) [@cowensel](https://discuss.elastic.co/u/cowensel)\
**Post date:** [September 26, 2018, 2:24pm UTC](https://discuss.elastic.co/t/powershell-the-events-stats-logstash/149823/3 "2018-09-26T14:24:33Z")

</div>

I would like to be able to restart logstash if logstash has stopped processing any new events. I do have logstash pinging redis every 30 seconds. Is there a way I can use this to determine if no new events are being collected?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [September 26, 2018, 6:50pm UTC](https://discuss.elastic.co/t/powershell-the-events-stats-logstash/149823/4 "2018-09-26T18:50:22Z")

</div>

> I do have logstash pinging redis every 30 seconds.

What do you mean by 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:** [October 24, 2018, 6:50pm UTC](https://discuss.elastic.co/t/powershell-the-events-stats-logstash/149823/5 "2018-10-24T18:50:23Z")

</div>

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