【发布时间】:2022-11-05 01:06:29
【问题描述】:
我正在尝试使用 az cli schedule-query 命令预配 Azure 警报,但在使用 --condition 时遇到了困难。
以下是我试图通过 az cli 提供的内容:
我使用的命令是:
az monitor scheduled-query create --condition "avg 'AggregatedValue' > 1 at least 1 violations out of 5 aggregated points" \
--condition-query "KubeEvents \n| where ClusterName =~ 'esg-aks-asse-aks-d'\n| where ObjectKind =~ 'Pod'\n| where Reason =~ 'BackOff'\n| project TimeGenerated, Name, ObjectKind, Reason, Message, Namespace, Count\n| summarize AggregatedValue=sum(Count) by bin(TimeGenerated, 5m) \n" \
--name "esg-txc-dev-podbackoff" \
--resource-group "<myrg>" \
--scopes "<myscope>" \
--target-resource-type "Kubernetes service" \
--action-groups "<myactiongroup>" \
--description "Pod Back Off Alert" \
--evaluation-frequency "5m" \
--severity 2 \
--skip-query-validation false \
--window-size "5m"
但是,当我运行它时收到以下错误:
无论如何/指南如何在 Azure Portal UI 中获得等效的 --condition ?
谢谢
【问题讨论】:
标签: azure command-line-interface