Read what Azi proposes
KQL Basics
Goal: Read and tweak the queries Azi writes for you. You do not need to master KQL.
Warm queries are written in KQL (Kusto Query Language). Azi writes it for you, so most of the time you just describe what you want and approve the result. This page is the small amount of KQL worth knowing so you can read a proposal, sanity-check it, and make a quick edit before you save.
THE SHAPE
Read it left to right
KQL flows top to bottom through pipes. Start with a table, then each step filters, groups, or sorts what came before. If you can read that flow, you can read most queries.
The basic structure
ProductData
| where Timestamp > ago(24h)
| summarize signups = count() by bin(Timestamp, 1h)
| order by Timestamp asc
Read it as: take ProductData, keep the last 24 hours, count rows into hourly buckets, sort oldest to
newest. That is a complete warm query.
The operators you'll see most
| Operator | Does | Example |
|---|---|---|
where | filter rows | where Campaign == "spring" |
summarize | aggregate (count, average, ...) | summarize total = count() |
by | group the aggregate | summarize count() by Campaign |
project | pick columns | project Timestamp, Campaign |
order by | sort | order by Timestamp desc |
take | first N rows (quick peek) | take 10 |
Time and aggregation
- Time windows:
ago(1h),ago(24h),ago(7d)- relative to now. - Bucketing:
bin(Timestamp, 1h)groups rows into hourly buckets (use1dfor daily). - Aggregations:
count(),avg(value),sum(value),min(value),max(value).
Reading one of Azi's proposals
When Azi proposes a query, scan it in five steps:
- Table - what data is it reading? (the first line)
where- what is it filtering to? (time range, a campaign, a threshold)summarize- what is it counting or averaging?by- what is it grouping by? (per hour, per campaign)order by- how is it sorted?
If those five match what you asked for, approve it.
Quick edits you can make by hand
| Want to change | Edit |
|---|---|
| The time window | ago(24h) becomes ago(7d) |
| The threshold | > 40 becomes > 100 |
| The grouping | by bin(Timestamp, 1h) becomes by Campaign |
| The metric | count() becomes avg(Value) |
You can edit the query text directly in the Warm Query Manager, run a preview, then save. Or just ask Azi to make the change - see Working with Azi.
Next steps
- Build queries by describing them -> Working with Azi
- The shapes that come up most -> Query Patterns
- Save one as a shared source of truth -> Warm Queries