Quarantine Release Percentage
Description
This query calculates the percentage of quarantined emails that were subsequently released, out of the total quarantined.
Query · kql
let Quarantine_Releases = toscalar(EmailPostDeliveryEvents | where Timestamp > ago(30d) | where Action == "Quarantine release" | distinct NetworkMessageId, RecipientEmailAddress | count); let Quarantined_Mailflow = toscalar(EmailEvents | where Timestamp > ago(30d) | where DeliveryLocation == "Quarantine" | distinct NetworkMessageId, RecipientEmailAddress | count); print Quarantine_Releases = toreal(Quarantine_Releases), Quarantined_Mailflow = toreal(Quarantined_Mailflow), Release_Percentage = iff(Quarantined_Mailflow == 0, 0.0, round((toreal(Quarantine_Releases) / toreal(Quarantined_Mailflow)) * 100, 2))