jerem0808
jerem0808

Reputation: 95

How to fire an alert based on a log and close it based on another log in loki

I have setup an alerting system between Loki and AlertManager and it’s working well. I can create an alert based on a rate of logs or a single occurence of a log. What i’m trying to do now is to send an alert when a log appear (new alarm) and stop it when another log is seen (deleted alarm).

I have the following two logs one that should trigger an alarm and as long as the second one isn't there the alarm should still fire.

count_over_time({app="alarm-handler"} | json | message="New alarm" [1m])

count_over_time({app="alarm-handler"} | json | message="Deleted alarm" [1m])

Upvotes: 0

Views: 22

Answers (0)

Related Questions