I am trying to create an alert rule in Application Insights based on a Kusto query.
If the resultset is empty, I want to fire the alert.
If I set the alert logic to:
operater = Equal To and the Threshold Value = 0,
it does not work.
Which seems to me to be correct, that it does not work, but I cannot check on "Empty".
Maybe someone has a solution?
Thanks in advance.
2
Answers
I have reproduced in my environment and got expected results as below and I followed Microsoft-Document:
While creating alert rule:
After selecting Custom log search then type the query:
And then in next section equal to and then threshold to 0:
The problem might be in your actions section of creating alert.
Output:
I followed the Microsoft document and got alert, please try to follow the process you will definitely get alert
Alternatively, you can use
Query | Count
You can create an alert rule in Application Insights based on a Kusto query and fire the alert when the result set is empty. To do this, you can use the "count" aggregation function in your Kusto query to count the number of rows returned by the query. If the count is zero, then you can fire the alert.
your_kusto_query_here
| count