VeriKQL by Kaushik Saha

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

Match text

Commands has · contains · startswith · in · in~ · has_any

What these commands do

CommandWhat it doesShape
hasFinds a whole word inside a value. Fast, and the one to reach for firstCol has "word"
containsFinds any piece of text, even inside a word. SlowerCol contains "text"
startswithThe value begins with this textCol startswith "text"
inThe value is one of a listCol in ("a", "b")
in~One of a list, ignoring caseCol in~ ("a", "b")
has_anyHas at least one of these wordsCol has_any ("a", "b")

See them work

Every address in one range starts with the same text:

SigninLogs
| where IPAddress startswith "203.0.113."
| distinct IPAddress
✓ Verified by VeriKQLKusto.Language 12.4.1 · bundle 2026.10.29

Result on the sample · 2 rows

IPAddress
203.0.113.77
203.0.113.45

Two attacker addresses. has finds a whole word, and contains any piece of text:

SigninLogs
| where AppDisplayName has "PowerShell" or UserPrincipalName contains "admin"
| distinct UserPrincipalName, AppDisplayName
✓ Verified by VeriKQLKusto.Language 12.4.1 · bundle 2026.10.29

Result on the sample · 6 rows

UserPrincipalNameAppDisplayName
it.admin@contoso.comMy Apps
it.admin@contoso.comAzure Portal
it.admin@contoso.comOffice 365 Exchange Online
it.admin@contoso.comOffice 365 SharePoint Online
it.admin@contoso.comMicrosoft Graph PowerShell
alex.morgan@contoso.comMicrosoft Graph PowerShell

in~ checks a list without caring about case:

SigninLogs
| where Location in~ ("nl", "de")
| summarize SignIns = count() by Location
✓ Verified by VeriKQLKusto.Language 12.4.1 · bundle 2026.10.29

Result on the sample · 2 rows

LocationSignIns
DE12
NL13

has_any finds apps by any of several words:

SigninLogs
| where AppDisplayName has_any ("SharePoint", "Storage")
| distinct AppDisplayName
✓ Verified by VeriKQLKusto.Language 12.4.1 · bundle 2026.10.29

Result on the sample · 2 rows

AppDisplayName
Office 365 SharePoint Online
Azure Storage

Your turn

Show the sign-ins that failed with a wrong password (50126) or a lock-out (50053), using in.

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

Result on the sample · 19 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 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
2026-06-10 07:44:30tom.becker@contoso.com198.51.100.2350126
2026-06-10 08:16:31alex.morgan@contoso.com203.0.113.4550126

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.