-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAIRTimeChartProblems.kql
33 lines (31 loc) · 1.67 KB
/
AIRTimeChartProblems.kql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
SecurityIncident
| where TimeGenerated >= ago(30d)
| summarize arg_max(TimeGenerated,*) by IncidentNumber
//| extend Alerts = extract("\\[(.*?)\\]", 1, tostring(AlertIds))
| mv-expand AlertIds to typeof(string)
| join ( SecurityAlert
| extend AIRstatus = parse_json(todynamic(ExtendedProperties))['Status']
| where AIRstatus contains 'Investigation started'
) on $left.AlertIds == $right.SystemAlertId
| project IncidentNumber, IncidentName, SystemAlertId, AIRstatus, TimeGenerated, TenantId
| join kind = leftanti ( SecurityIncident
| summarize arg_max(TimeGenerated,*) by IncidentNumber
//| extend Alerts = extract("\\[(.*?)\\]", 1, tostring(AlertIds))
| mv-expand AlertIds to typeof(string)
| join ( SecurityAlert
| extend AIRstatus = parse_json(todynamic(ExtendedProperties))['Status']
| where AIRstatus in ('Pending Action', 'No threats found', 'Remediated', 'Partially Remediated', 'Threats Found', 'Failed')
) on $left.AlertIds == $right.SystemAlertId
| project IncidentNumber, IncidentName, SystemAlertId, AIRstatus, TimeGenerated, TenantId) on $left.IncidentNumber == $right.IncidentNumber
| extend Customer = ResolveWorkspaceId(TenantId)
| summarize count() by bin(TimeGenerated, 1h), Customer
| render timechart
SecurityIncident
| where TimeGenerated >= ago(30d)
| summarize arg_max(TimeGenerated,*) by IncidentNumber
//| extend Alerts = extract("\\[(.*?)\\]", 1, tostring(AlertIds))
| mv-expand AlertIds to typeof(string)
| join ( SecurityAlert
| extend AIRstatus = parse_json(todynamic(ExtendedProperties))['Status']
| where AIRstatus contains 'Failed'
) on $left.AlertIds == $right.SystemAlertId