Hunting - Email Actions Threat Hunting

This rule performs threat hunting across Microsoft Defender for Office 365 and Microsoft Defender for Endpoint datasets to track a suspect email (by subject keyword) through its lifecycle: delivery, post-delivery actions, URL clicks, file drops on endpoints, and file execution. I would recommend saving it as a function with Lookback and SubjectKeyword as parameters. First remove the first two lines of the query , set Lookback to 'timespan' with a default of 30d, and SubjectKeyword to string with no default. I have it named as 'emailThreatHunt' in my functions, which means I only need to type: emailThreatHunt("subject") to get all the email actions, links clicked, attachments downloaded/executed in one query