如何在 Azure 中使用 Kusto 划分计数?

How to divide the count number in with Kusto in Azure?

我在 Azure 中有一个日志查询,看起来像这样:

table
    | where timestamp > ago(30min) 
    | count

我想要的是将该计数除以一个数字,例如“5”。我尝试了下面的查询,但它引发了异常。我怎样才能用另一种方式做到这一点?

table
    | where timestamp > ago(30min) 
    | count / 5

你必须先投影它,因为 count 是一个运算符,而不是像 count() 这样的普通数字或函数:

requests
| where timestamp > ago(30min) 
| count
| project Count / 5

另一种方法是使用 count() 函数:

requests
| where timestamp > ago(30min) 
| summarize count() / 5