Level 2 · Count and compare · Mission 3 of 5 · by Kaushik Saha
Filter the groups
Alert Spray or brute force? · Idea where after summarize
Commands here where · != · count · summarize · dcount · all commands
Briefing
A SOC can't read every address. A detection keeps only the groups that cross a line: here, an address that failed against more than five users.
One idea: where works on the summarized rows too
SigninLogs
| where ResultType != "0"
| summarize Failures = count(), Users = dcount(UserPrincipalName) by IPAddress
| where Users > 5
Result on the sample · 1 row
| IPAddress | Failures | Users |
|---|---|---|
| 198.51.100.23 | 12 | 12 |
One row: the spray. This is the shape of a real password-spray detection, with the threshold your team chooses.
Your turn
Show only the addresses with five or more failures, with the number of failures and of users.
Write it in the box below and check it. Then compare with one answer; others can be right too.
Show one answer
SigninLogs
| where ResultType != "0"
| summarize Failures = count(), Users = dcount(UserPrincipalName) by IPAddress
| where Failures >= 5
Result on the sample · 2 rows
| IPAddress | Failures | Users |
|---|---|---|
| 198.51.100.23 | 12 | 12 |
| 203.0.113.45 | 8 | 1 |
Check your own query
Write your query for the task above and check it against the real schema.
Debrief
where before summarize chooses the rows to count; where after it chooses the groups to show. Next, find when
each attack happened.
All data on this page is sample data, made up for this course. The IP addresses come from ranges reserved for documentation, and the people and the company are fictional.
Mission by Kaushik Saha. Every query checked with Microsoft.Azure.Kusto.Language 12.4.1 against schema bundle 2026.10.29; every result computed on the course's sample with Kusto-Loco 1.4.9, an open-source KQL engine (credits). The story's clock reads 12:00 UTC on 10 June 2026.