Forum Discussion

SocInABox's avatar
SocInABox
Iron Contributor
Mar 20, 2021
Solved

kql query for distinct values

Hi there, I'm trying to query all computers that match 2 or more DISTINCT DisplayName fields. I can get the distinct count: SecurityAlert | where ProductName in("Microsoft Defender Advanced Threa...
  • CliveWatson's avatar
    CliveWatson
    Mar 23, 2021

    GaryBushey 

    You might also try?

     

    SecurityAlert
    | where ProductName in("Microsoft Defender Advanced Threat Protection")
    | where ProviderName == "MDATP"
    | mv-expand parsejson(Entities)
    | extend Computer = tostring(Entities.HostName)
    | where isnotempty(Computer)
    | summarize dcount(DisplayName), make_set(DisplayName) by Computer

Resources