Learn how to use distinct to reduce repeated rows and identify unique evidence across Microsoft Defender XDR and Sentinel telemetry.
Finding unique users and devices
Reducing repeated telemetry rows
Building investigation pivot lists
🔎 Repeated rows can hide the values that matter. distinct helps defenders strip away duplication and focus on the unique users, IPs, domains, devices and senders involved in an investigation.
Show me each user who appeared in sign-in logs during the last 24 hours, but only list each user once.
Understanding distinct
distinct does not count results. It removes duplicates from the selected columns and returns the unique values.
One columndistinct UserPrincipalName returns a clean list of unique users.
Multiple columnsdistinct UserPrincipalName, IPAddress returns unique user and IP combinations.
No event countIf you need counts, use summarize. If you need unique values, use distinct.
Finding unique IP addresses
Unique IP addresses are useful during sign-in investigations, impossible travel reviews, suspicious session analysis and Conditional Access troubleshooting.
IP addressShows the network source used during the sign-in.
LocationAdds context that can help identify suspicious or unexpected sign-in geography.
Finding unique email senders
distinct is very useful for email investigations. Instead of reviewing every email row, defenders can quickly list the unique senders involved in a campaign.
Find the unique senders and sender domains involved in invoice-related emails over the last 24 hours.
Finding unique devices involved in endpoint activity
During endpoint investigations, repeated process rows can make it difficult to see which devices are actually involved. distinct can quickly produce a clean device list.
In this lesson, you learned how distinct helps defenders remove repetition and find unique values inside Microsoft security telemetry.
distinct removes duplicatesIt returns unique values or unique combinations from the columns you choose.
unique values become pivotsUsers, IP addresses, devices, domains and senders can become the next step in an investigation.
distinct is not countingUse distinct to find unique values. Use summarize count() when you need volume.
Next lesson coming soon
The next Agent Foskett Academy lesson will introduce top, helping defenders quickly identify the highest-volume users, devices, IP addresses, senders and suspicious activity across Microsoft security telemetry.
Lesson 10 — Using top to Find High-Volume ActivityLearn how top helps defenders quickly surface the busiest accounts, IP addresses, devices, senders and domains.
Keep building the investigationAfter finding unique values, the next step is learning how to rank the most active or suspicious values.
Develop IT. Protect IT.GEMXIT PTY LTD | GEMXIT UK LTD
Finding Unique Values with distinct in KQL
Agent Foskett Academy Lesson 9 teaches defenders how to use distinct inside Microsoft Defender XDR and Microsoft Sentinel investigations to find unique users, devices, IP addresses, domains and senders.
Learn KQL distinct for Microsoft Defender XDR
KQL distinct helps defenders reduce repeated telemetry rows and create clean investigation pivot lists across Microsoft security data.
KQL Unique Value Analysis for Security Investigations
Unique value analysis helps defenders investigate SigninLogs, EmailEvents, DeviceProcessEvents, suspicious sign-ins, phishing campaigns, endpoint activity, user accounts, sender domains, IP addresses and Microsoft security telemetry.