VeriKQL by Kaushik Saha

Level 0 · Your toolkit · Card 2 of 9 · by Kaushik Saha

Filter rows

Commands where · == · != · =~ · and · or

What these commands do

CommandWhat it doesShape
whereKeeps the rows where a condition is trueT | where Col == "value"
==Equals, exactly (case matters)Col == "value"
!=Is not equalCol != "value"
=~Equals, ignoring upper and lower caseCol =~ "VALUE"
and / orBoth conditions must be true / either one may beA == 1 and B == 2

See them work

Every sign-in that didn't succeed, from one address:

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

Result on the sample · 8 rows

TimeGeneratedUserPrincipalNameResultType
2026-06-10 08:17:05alex.morgan@contoso.com50126
2026-06-10 08:19:44alex.morgan@contoso.com500121
2026-06-10 08:15:10alex.morgan@contoso.com50126
2026-06-10 08:14:02alex.morgan@contoso.com50126
2026-06-10 08:19:12alex.morgan@contoso.com50126
2026-06-10 08:16:31alex.morgan@contoso.com50126
2026-06-10 08:18:41alex.morgan@contoso.com50126
2026-06-10 08:20:09alex.morgan@contoso.com500121

=~ finds the user however the name is typed:

SigninLogs
| where UserPrincipalName =~ "Alex.Morgan@Contoso.com"
| count
✓ Verified by VeriKQLKusto.Language 12.4.1 · bundle 2026.10.29

Result on the sample · 1 row

Count
16

With ==, the same query finds nothing, because the stored name is in lower case.

Your turn

Show the sign-ins that failed (ResultType is not "0") and came from the Netherlands (Location is "NL").

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

Result on the sample · 8 rows

TimeGeneratedUserPrincipalNameIPAddressResultType
2026-06-10 08:17:05alex.morgan@contoso.com203.0.113.4550126
2026-06-10 08:19:44alex.morgan@contoso.com203.0.113.45500121
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 08:19:12alex.morgan@contoso.com203.0.113.4550126
2026-06-10 08:16:31alex.morgan@contoso.com203.0.113.4550126
2026-06-10 08:18:41alex.morgan@contoso.com203.0.113.4550126
2026-06-10 08:20:09alex.morgan@contoso.com203.0.113.45500121

Check your own query

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

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.

Card 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.