VeriKQL by Kaushik Saha

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

Find the failures

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

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

Briefing

Alex says the prompts came "at about twenty past eight". Before looking at Alex, see what failed this morning.

SigninLogs · 6 of 141 sample rows
TimeGeneratedUserPrincipalNameIPAddressResultType
2026-06-10 07:45:44raj.patel@contoso.com198.51.100.2350126
2026-06-10 08:28:33mei.chen@contoso.com192.0.2.100
2026-06-10 09:40:23omar.haddad@contoso.com192.0.2.340
2026-06-10 09:31:09julia.santos@contoso.com192.0.2.100
2026-06-10 08:03:58mei.chen@contoso.com192.0.2.100
2026-06-10 08:29:37priya.nair@contoso.com192.0.2.100

Sample data, made up for this course. The IP addresses come from ranges reserved for documentation, and the people and the company are fictional.

One idea: where keeps the rows that match

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

Result on the sample · 25 rows, the first 16 shown

TimeGeneratedUserPrincipalNameIPAddressResultType
2026-06-10 07:45:44raj.patel@contoso.com198.51.100.2350126
2026-06-10 07:43:53lena.fischer@contoso.com198.51.100.2350126
2026-06-10 08:17:05alex.morgan@contoso.com203.0.113.4550126
2026-06-10 07:41:25sam.okafor@contoso.com198.51.100.2350126
2026-06-10 10:18:00mei.chen@contoso.com192.0.2.1050074
2026-06-10 08:19:44alex.morgan@contoso.com203.0.113.45500121
2026-06-10 07:40:11alex.morgan@contoso.com198.51.100.2350126
2026-06-10 07:46:21ben.carter@contoso.com198.51.100.2350126
2026-06-10 07:40:48priya.nair@contoso.com198.51.100.2350126
2026-06-10 07:45:07sara.lind@contoso.com198.51.100.2350126
2026-06-10 07:46:58it.admin@contoso.com198.51.100.2350126
2026-06-10 08:15:10alex.morgan@contoso.com203.0.113.4550126
2026-06-10 08:14:02alex.morgan@contoso.com203.0.113.4550126
2026-06-10 09:47:12ben.carter@contoso.com192.0.2.2050126
2026-06-10 07:42:39omar.haddad@contoso.com198.51.100.2350126
2026-06-10 08:19:12alex.morgan@contoso.com203.0.113.4550126

!= means "is not". Every row left is a sign-in that didn't succeed. The codes you'll meet today:

ResultType What it means
50126 Wrong user name or password
50053 Account locked after too many wrong passwords
500121 The password was right, but the MFA prompt was denied
50074 MFA was required: the user was asked for a second factor (normal)
50140 The "stay signed in?" prompt (normal)

Your turn

Show only the wrong-password failures (50126), with the time, the user and the address.

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 == "50126"
| project TimeGenerated, UserPrincipalName, IPAddress
✓ Verified by VeriKQLKusto.Language 12.4.1 · bundle 2026.10.29

Result on the sample · 18 rows, the first 16 shown

TimeGeneratedUserPrincipalNameIPAddress
2026-06-10 07:45:44raj.patel@contoso.com198.51.100.23
2026-06-10 07:43:53lena.fischer@contoso.com198.51.100.23
2026-06-10 08:17:05alex.morgan@contoso.com203.0.113.45
2026-06-10 07:41:25sam.okafor@contoso.com198.51.100.23
2026-06-10 07:40:11alex.morgan@contoso.com198.51.100.23
2026-06-10 07:46:21ben.carter@contoso.com198.51.100.23
2026-06-10 07:40:48priya.nair@contoso.com198.51.100.23
2026-06-10 07:45:07sara.lind@contoso.com198.51.100.23
2026-06-10 07:46:58it.admin@contoso.com198.51.100.23
2026-06-10 08:15:10alex.morgan@contoso.com203.0.113.45
2026-06-10 08:14:02alex.morgan@contoso.com203.0.113.45
2026-06-10 09:47:12ben.carter@contoso.com192.0.2.20
2026-06-10 07:42:39omar.haddad@contoso.com198.51.100.23
2026-06-10 08:19:12alex.morgan@contoso.com203.0.113.45
2026-06-10 07:44:30tom.becker@contoso.com198.51.100.23
2026-06-10 08:16:31alex.morgan@contoso.com203.0.113.45

Check your own query

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

Debrief

Not every failure is an attack: 50074 and 50140 are everyday prompts. Some addresses fail far more than others. Next, put the failures in time order.

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.