GitHubContribute in GitHub: オンラインでの編集

countif () (集約関数)

Predicatetrueに評価される行の数を返します。 summarize内の集約のコンテキストでのみ使用できます。

構文

countif (述部)

引数

述部: 集約の計算に使用される式。 述部 は、戻りの型がブール (真/偽と評価される) の任意のスカラー式にすることができます。

この照会は、 Predicatetrueと評価する行の数を返します。 述部と一致しない行は引き続き返されますが、それらのレコードはカウントされないことに注意してください。

events 
    | project severity, original_time
    | where original_time > ago(24h)
    | summarize EventCount=countif(severity > 6) by EventSeverity=severity
    | order by EventSeverity desc

結果

EventSeverity EventCount
10 245015
9 1401646
8 360175
6 0
5 0
4 0
3 0
2 0
1 0

関連資料

count () 関数。述部式のない行をカウントします。