GitHub GitHub: 線上編輯

count () (總計函數)

傳回每個摘要群組的記錄計數 (或總計,如果摘要已完成而沒有分組的話)。

  • 只能在 summarize 內聚集的環境定義中使用
  • 使用 countif 聚集函數只計算部分述詞傳回 true的記錄。

語法

count()

退貨

傳回每個摘要群組的記錄計數 (或總計,如果摘要已完成而沒有分組的話)。

範例

此範例只是依其 severity聚集 events

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

結果

EventSeverity EventCount
10 245015
9 1401646
8 360175
7 1258226