Query Details
let query_frequency = 1h;
let query_lookback = 3d;
let _MonitoredRules = toscalar(
_GetWatchlist('AlertName-SubstitutedDetections')
| where ProductName == "Anomalies"
| summarize make_list(AlertName)
);
Anomalies
| where TimeGenerated > ago(query_frequency)
| where not(replace_string(replace_string(RuleName, "(Preview) ", ""), " - Customized", "") in (_MonitoredRules))
| join kind = leftanti (
Anomalies
| where TimeGenerated between (ago(query_frequency + query_lookback) .. ago(query_frequency))
| distinct RuleName
) on RuleName
This KQL query is designed to identify specific anomaly detection rules that have generated alerts within the last hour but have not done so in the previous three days. Here's a breakdown of what the query does:
Parameters Definition:
query_frequency is set to 1 hour, indicating the recent time window for analysis.query_lookback is set to 3 days, representing the historical period to compare against.Watchlist Retrieval:
Current Alerts Filtering:
Anomalies table to include only those alerts generated in the last hour (query_frequency).Exclusion of Monitored Rules:
Historical Comparison:
Anomalies data, which includes distinct rule names from the past 3 days up to 1 hour ago.In summary, the query identifies anomaly detection rules that have triggered alerts in the last hour but did not trigger any alerts in the preceding three days, excluding certain monitored rules.

Jose Sebastián Canós
Released: November 25, 2024
Tables
Keywords
Operators