Top Domains Outbound with Emails with Threats Inbound (Partner BEC)
Description
This query visualises top outbound recipient domains by outbound email volume and shows total number of inbound emails with Threats from the same domains (as inbound senders)
Query · kql
EmailEvents | where EmailDirection == "Outbound" | project RecipientDomain = tostring(split(RecipientEmailAddress, "@")[1]) | summarize count() by RecipientDomain | project OutboundCount=count_, RecipientDomain, SenderFromDomain=RecipientDomain | join (EmailEvents | where EmailDirection == "Inbound" and isempty(ThreatTypes)==false) on SenderFromDomain | summarize max(OutboundCount),count() by SenderFromDomain | project SenderFromDomain, OutboundEmails=max_OutboundCount, IncomingEmailsWithThreats=count_ | sort by OutboundEmails