Watcher to notify if only last snapshot failed

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?

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.

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

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