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

5.1k views Asked by At

I have a log query in Azure that looks something like this:

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

What I want is to divide that count with a number, for example "5". I tried the query below but it throws an exception. How can I do this in another way?

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

There are 1 answers

0
Peter Bons On BEST ANSWER

You have to project it first because count is an operator and not an ordinary number or function like count() :

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

An other way is using the count() function:

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