Quantcast
Channel: Azure フォーラム
Viewing all articles
Browse latest Browse all 1798

Azure アラート機能で平均値を比較するクエリを組みたい

$
0
0

azure機能の1つであるアラートで、

24時間以内に検知したエラー数と

過去一定期間で検知したエラー数の平均を比較し、

前者の数値が多ければ通知するクエリを設定したいのですが、

上手く関数の組み合わせができない状態です。



〇クエリ

traces

| where (itemtype == 'trace' and severityLevel >= 3)

| where timestamp >= ago(7d)

| summarize COUNT1 = count() by bin(timestamp,1d)  //24時間

| summarize COUNT2 = count() by bin(timestamp,7d)  //7日間

| extend num = COUNT1 - (COUNT2 / 7) //エラー件数の差 = 24時間以内のエラー数 - (過去7日間のエラー数 / 7)



〇上記クエリのエラー

summrize関数を2つ定義して

1日、7日のエラーをそれぞれ求めても

以下のエラーが出てしまいます。

"the name 'COUNT1' does not refer to any known column, variable or function.



〇お願い事項

上記エラーの解決方法or同様の集計が可能なクエリを教えていただきたいです。


Viewing all articles
Browse latest Browse all 1798


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>