VeriKQL by Kaushik Saha

Level 4 · Same user, two countries · Mission 5 of 5 · by Kaushik Saha

Level 4 bug hunt

Alert Impossible travel · Idea fix it

Commands here where · == · count · summarize · extend · tostring · dot notation · all commands

Briefing

A colleague's per-country count won't compile. Two mistakes, both about the nested column.

SigninLogs
| where ResultType == "0"
| extend Country = LocationDetails.countryOrRegion, City = LocationDetail.city
| summarize SignIns = count() by UserPrincipalName, Country
✗ Broken on purpose2 problems: KS142 on line 3, KS116 on line 4

Hint: one is a spelling mistake; the other is a dynamic value used where only a plain value can go.

Your turn

Fix the query so it compiles and counts each user's successful sign-ins per country.

Paste the query into the box, check it and fix what the checker reports. Then compare with one answer.

Show one answer
SigninLogs
| where ResultType == "0"
| extend Country = tostring(LocationDetails.countryOrRegion), City = tostring(LocationDetails.city)
| summarize SignIns = count() by UserPrincipalName, Country
✓ Verified by VeriKQLKusto.Language 12.4.1 · bundle 2026.10.29

Result on the sample · 13 rows

UserPrincipalNameCountrySignIns
mei.chen@contoso.comUS10
omar.haddad@contoso.comUS9
julia.santos@contoso.comUS9
priya.nair@contoso.comUS10
lena.fischer@contoso.comGB9
it.admin@contoso.comUS14
ben.carter@contoso.comGB10
sara.lind@contoso.comGB10
tom.becker@contoso.comGB10
alex.morgan@contoso.comNL5
sam.okafor@contoso.comUS9
raj.patel@contoso.comGB9
alex.morgan@contoso.comUS2

Check your own query

The broken query is in the box: check it, fix what the checker reports and check it again.

Level 4 cleared

4

Level 4 clue · pinned to the incident

Impossible travel. Alex signed in from Seattle at 08:12:33 and from Amsterdam at 08:20:36: 7,826 km in eight minutes. The Amsterdam sign-in was the attacker, with a password guessed from 203.0.113.45.

You can now read nested fields, count different values, subtract times and measure distances. Level 5 follows the attacker after 08:20: what did they open, and how did they get past MFA?

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.