VeriKQL by Kaushik Saha

Level 2 · Count and compare · Mission 1 of 5 · by Kaushik Saha

Count by address

Alert Spray or brute force? · Idea summarize · count

Commands here where · != · sort by · count · summarize · all commands

Briefing

Level 1 ended with a question. Alex's password was guessed from 203.0.113.45, but at 07:40 another address, 198.51.100.23, failed against almost everyone. One attacker, or two? Start by counting.

One idea: summarize ... by gives one row per group

Instead of reading 25 failures one by one, count them per address:

SigninLogs
| where ResultType != "0"
| summarize Failures = count() by IPAddress
| sort by Failures desc
✓ Verified by VeriKQLKusto.Language 12.4.1 · bundle 2026.10.29

Result on the sample · 4 rows

IPAddressFailures
198.51.100.2312
203.0.113.458
192.0.2.203
192.0.2.102

Four addresses. Two are Contoso's own offices (192.0.2.x) with a few everyday failures. Two are not, and they fail far more often.

Your turn

Count the failed sign-ins per user, most first.

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() by UserPrincipalName
| sort by Failures desc
✓ Verified by VeriKQLKusto.Language 12.4.1 · bundle 2026.10.29

Result on the sample · 12 rows

UserPrincipalNameFailures
alex.morgan@contoso.com9
mei.chen@contoso.com2
ben.carter@contoso.com2
priya.nair@contoso.com2
sara.lind@contoso.com2
tom.becker@contoso.com2
raj.patel@contoso.com1
lena.fischer@contoso.com1
sam.okafor@contoso.com1
it.admin@contoso.com1
omar.haddad@contoso.com1
julia.santos@contoso.com1

Check your own query

Write your query for the task above and check it against the real schema.

Debrief

Counting turns a long list into a short answer. But a count alone can't tell a spray from a brute force: both fail a lot. Next, count who each address tried.

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.