我进行了此搜索,但是我想在带宽达到50%时发出警报。我已经尝试过警报设置,但是只能设置搜索找到的次数。因此不确定在搜索中需要添加的内容只会触发带宽阈值。
AzureMetrics
| where ResourceId contains "ckt"
| where MetricName == "BitsINPerSecond"
| where TimeGenerated > (now() - 12h) and TimeGenerated <= now()
| project TimeGenerated, Resource, inBytes=Maximum
| join kind= inner
(
AzureMetrics
| where MetricName == "BitsOutPerSecond"
| where TimeGenerated > (now() - 12h) and TimeGenerated <= now()
| project TimeGenerated, Resource, outBytes= Maximum
)
on TimeGenerated, Resource
| summarize data_in_Gbps = max(inBytes)/1000000000, data_out_Gbps = max(outBytes)/1000000000,
data_total_Gbps = sum(inBytes + outBytes)/1000000000 by bin(TimeGenerated, 1h), Resource
| extend BW_percentage = data_out_Gbps * 100
| order by TimeGenerated
答案 0 :(得分:1)
在查询末尾添加:“ | where BW_percentage> 50”。 自己运行查询时,请检查结果是否满意。 然后将查询复制到警报规则,并将阈值设置为> 0,以在出现这种情况的任何一种资源上向您发出警报。 (如果这是您感兴趣的时间范围,则可以将1h更改为30m)。