我正在尝试为 Azure 监视器警报规则设置新的自定义条件,但是当我输入我的 kql 查询时,它没有显示预期的数据。当我在 Logs 中运行相同的查询时,它会输出 9 行满足我的条件,但由于某种原因,Monitor Alerts 中没有显示任何数据。
我可以看到问题出在最后一个条件| where Anomaly has "1"
中,因为我在删除此条件时获取数据 - 但我需要将其包含在查询中(或至少是它的类似版本)。有什么建议么?(我也试过 contains 和 == 但它给出了同样的问题)
ADFPipelineRun
| where TimeGenerated >= ago(30d)
| where PipelineName startswith "Dataflow"
| extend customerName = extractjson("$.customerName", Parameters, typeof(string))
| extend customerBranchName = extractjson("$.customerBranchName", Parameters, typeof(string))
| extend databaseName = extractjson("$.databaseName", Parameters, typeof(string))
| join (ADFActivityRun
| where ActivityType == "Copy" and Status == "Succeeded"
| extend RowsCopied = extractjson("$.rowsCopied", Output, typeof(int)))
on CorrelationId
| summarize AggregatedValue=any(RowsCopied) by customerName, customerBranchName, databaseName, PipelineName, bin(TimeGenerated,1d)
| order by TimeGenerated
| summarize EventCount=make_list(AggregatedValue),TimeGenerated=make_list(TimeGenerated) by customerName, customerBranchName, databaseName, PipelineName
| extend (anomalies, score, baseline)=series_decompose_anomalies(EventCount, 5, 0, "avg")
| extend Anomaly = array_slice(anomalies,0,0)
| where Anomaly has "1"
感谢您的任何好主意和帮助:)