Level 4 · Same user, two countries · Mission 3 of 5 · by Kaushik Saha
How fast?
Alert Impossible travel · Idea join · time arithmetic
Commands here project · where · == · and / or · summarize · min / max · extend · let · join · kind=inner · all commands
Briefing
Alex's last sign-in in Seattle and first in Amsterdam: how far apart in time?
One idea: find each half, join them, and subtract
let LastHome = SigninLogs
| where ResultType == "0" and Location == "US"
| summarize LastHome = max(TimeGenerated) by UserPrincipalName;
let FirstAway = SigninLogs
| where ResultType == "0" and Location == "NL"
| summarize FirstAway = min(TimeGenerated) by UserPrincipalName;
LastHome
| join kind=inner FirstAway on UserPrincipalName
| extend Gap = FirstAway - LastHome
| project UserPrincipalName, LastHome, FirstAway, Gap
Result on the sample · 1 row
| UserPrincipalName | LastHome | FirstAway | Gap |
|---|---|---|---|
| alex.morgan@contoso.com | 2026-06-10 08:12:33 | 2026-06-10 08:20:36 | 00:08:03 |
Eight minutes and three seconds between Seattle and Amsterdam.
Your turn
Show the gap between Alex's first and last successful sign-in of the day, as a time span.
Write it in the box below and check it. Then compare with one answer; others can be right too.
Show one answer
SigninLogs
| where UserPrincipalName == "alex.morgan@contoso.com" and ResultType == "0"
| summarize First = min(TimeGenerated), Last = max(TimeGenerated)
| extend Gap = Last - First
Result on the sample · 1 row
| First | Last | Gap |
|---|---|---|
| 2026-06-10 07:56:42 | 2026-06-10 09:58:44 | 02:02:02 |
Check your own query
Write your query for the task above and check it against the real schema.
Debrief
Eight minutes is not a flight. Last step: put the distance and the time together, as an impossible-travel rule does.
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.