Automated Remediation Delivery to Action Latency
Description
This query measures how long after delivery Microsoft Defender for Office 365 automated remediation acts on a message, reported as daily average and percentiles, using the EmailEvents and EmailPostDeliveryEvents tables.
Query · kql
let deliveries = EmailEvents
| where Timestamp > ago(30d)
| where DeliveryAction == "Delivered"
| extend MsgKey = strcat(NetworkMessageId, "-", RecipientEmailAddress)
| summarize FirstDelivery = min(Timestamp) by MsgKey, Threat = tostring(ThreatTypes);
let remediations = EmailPostDeliveryEvents
| where Timestamp > ago(30d)
| where ActionType == "Automated Remediation"
| extend MsgKey = strcat(NetworkMessageId, "-", RecipientEmailAddress)
| summarize FirstRemediation = min(Timestamp) by MsgKey;
deliveries
| join kind=inner remediations on MsgKey
| extend DelayMinutes = datetime_diff("minute", FirstRemediation, FirstDelivery)
| where DelayMinutes >= 0
| summarize ['Avg (min)'] = avg(DelayMinutes), ['P80 (min)'] = percentile(DelayMinutes, 80), ['P90 (min)'] = percentile(DelayMinutes, 90), ['P99 (min)'] = percentile(DelayMinutes, 99), CountEmails = count() by bin(FirstRemediation, 1d)
| render timechart