# Watcher to notify if only last snapshot failed

**URL:** <https://discuss.elastic.co/t/watcher-to-notify-if-only-last-snapshot-failed/255891>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [November 18, 2020, 7:33pm UTC](https://discuss.elastic.co/t/watcher-to-notify-if-only-last-snapshot-failed/255891 "2020-11-18T19:33:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mwise29](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@mwise29](https://discuss.elastic.co/u/mwise29)\
**Post date:** [November 18, 2020, 7:33pm UTC](https://discuss.elastic.co/t/watcher-to-notify-if-only-last-snapshot-failed/255891/1 "2020-11-18T19:33:47Z")

</div>

I'm new to ElasticSearch and trying to setup a monitoring watch that would email me if the status of the last snapshot has failed. I've seen examples in the forums where they looked at the output for a /\_snapshot/repo/\_all request and sent an email if any were in a failed status. I'm just looking for if the last one failed. Is there a way to do this?

---

<div class="post-metadata">

**Author:** ![mwise29](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@mwise29](https://discuss.elastic.co/u/mwise29)\
**Post date:** [November 18, 2020, 8:46pm UTC](https://discuss.elastic.co/t/watcher-to-notify-if-only-last-snapshot-failed/255891/2 "2020-11-18T20:46:56Z")

</div>

I've tried to see if there was a way to loop through ctx.payload to get the last value, but couldn't find anything. I also couldn't find a get request to return the name of just the last snapshot taken.

---

<div class="post-metadata">

**Author:** ![mwise29](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@mwise29](https://discuss.elastic.co/u/mwise29)\
**Post date:** [November 18, 2020, 9:18pm UTC](https://discuss.elastic.co/t/watcher-to-notify-if-only-last-snapshot-failed/255891/3 "2020-11-18T21:18:16Z")

</div>

Correction find a request to just get the results of the last snapshot that was taken

---

<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:** [December 16, 2020, 9:18pm UTC](https://discuss.elastic.co/t/watcher-to-notify-if-only-last-snapshot-failed/255891/4 "2020-12-16T21:18:36Z")

</div>

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