VeriKQL by Kaushik Saha

Level 1 · Read the logs · Mission 3 of 5 · by Kaushik Saha

Newest first

Alert A user reports a strange sign-in prompt · Idea sort · top

Commands here project · where · != · top · all commands

Briefing

Rows come back in no particular order. To see what happened last, put them in time order.

One idea: sort orders the rows, top keeps the first few

SigninLogs
| where ResultType != "0"
| top 10 by TimeGenerated desc
| project TimeGenerated, UserPrincipalName, IPAddress, ResultType
✓ Verified by VeriKQLKusto.Language 12.4.1 · bundle 2026.10.29

Result on the sample · 10 rows

TimeGeneratedUserPrincipalNameIPAddressResultType
2026-06-10 11:02:00sara.lind@contoso.com192.0.2.2050140
2026-06-10 10:18:00mei.chen@contoso.com192.0.2.1050074
2026-06-10 09:47:12ben.carter@contoso.com192.0.2.2050126
2026-06-10 09:05:00tom.becker@contoso.com192.0.2.2050140
2026-06-10 08:31:00priya.nair@contoso.com192.0.2.1050074
2026-06-10 08:20:09alex.morgan@contoso.com203.0.113.45500121
2026-06-10 08:19:44alex.morgan@contoso.com203.0.113.45500121
2026-06-10 08:19:12alex.morgan@contoso.com203.0.113.4550126
2026-06-10 08:18:41alex.morgan@contoso.com203.0.113.4550126
2026-06-10 08:17:05alex.morgan@contoso.com203.0.113.4550126

top 10 by TimeGenerated desc is the same as sort by TimeGenerated desc followed by take 10: the ten newest. desc means newest first; asc means oldest first.

Your turn

Show the five oldest failures of the day, oldest 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"
| top 5 by TimeGenerated asc
| project TimeGenerated, UserPrincipalName, IPAddress, ResultType
✓ Verified by VeriKQLKusto.Language 12.4.1 · bundle 2026.10.29

Result on the sample · 5 rows

TimeGeneratedUserPrincipalNameIPAddressResultType
2026-06-10 07:40:11alex.morgan@contoso.com198.51.100.2350126
2026-06-10 07:40:48priya.nair@contoso.com198.51.100.2350126
2026-06-10 07:41:25sam.okafor@contoso.com198.51.100.2350126
2026-06-10 07:42:02mei.chen@contoso.com198.51.100.2350126
2026-06-10 07:42:39omar.haddad@contoso.com198.51.100.2350126

Check your own query

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

Debrief

The newest failures are everyday: MFA prompts, a "stay signed in?" and one mistyped password. Just before them, around 08:20, one user has two 500121 failures after a run of wrong passwords: the password was finally right, and the MFA prompt was denied. That user is Alex Morgan. Next, follow Alex.

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.