Forum Discussion

kishore_soc's avatar
kishore_soc
Copper Contributor
Aug 04, 2021
Solved

Help Needed

Hi Community,   I need to fetch the last 24 hours alerts on sentinel as a report. I have used the below query but that didn't work. can some one help me out on this...?   SecurityAlert | where P...
  • CliveWatson's avatar
    CliveWatson
    Aug 04, 2021

    kishore_soc 

     

    Scheduling a report - please see the "playbook" example here https://cloudblogs.microsoft.com/industry-blog/en-gb/cross-industry/2020/06/17/log-analytics-or-azure-sentinel-how-schedule-a-report/

     

    "Owner" is a column in SecurityIncident not SecurityAlert - hence the failure, so you need to join the two Tables

     

    SecurityIncident
    | summarize arg_max(TimeGenerated,*) by tostring(IncidentNumber)
    | extend Alerts = extract("\\[(.*?)\\]", 1, tostring(AlertIds))
    | mv-expand AlertIds to typeof(string)
    | join 
    (
        SecurityAlert
        | where ProductName == "Azure Defender" or ProductName == "Azure Active Directory Identity Protection"
        | extend AlertEntities = parse_json(Entities)
        | mv-expand AlertEntities
    )  on $left.AlertIds == $right.SystemAlertId
    | summarize by IncidentNumber, tostring(Owner), Title, Alerts, DisplayName, IncidentSeverity=Severity, AlertSeverity, Status
    

     

    Add this at the end of the last line for comments and tags (if required)

     

    , tostring(Comments), tags=tostring(Labels)

Resources