Forum Discussion

CodnChips's avatar
CodnChips
Brass Contributor
Mar 15, 2023
Solved

Specifying a blank\no value

This is harder than I anticipated. I want to query all emails sent inbound where no subject was specified.  Can't get the blank bit to work:  i.e. EmailEvents | where EmailDirection == "Inbound" ...
  • Clive_Watson's avatar
    Mar 15, 2023

    Updates: as part of the original reply was missed!


    EmailEvents
    | where EmailDirection == "Inbound" and SenderMailFromAddress contains "gmail.com"
    | project EmailDirection, SenderMailFromAddress, Subject
    | where isnotempty( Subject)

     

    and what you need (I hope):

    EmailEvents
    | where EmailDirection == "Inbound" and SenderMailFromAddress contains "gmail.com"
    | project EmailDirection, SenderMailFromAddress, Subject
    | where isempty(Subject)

     
    Tested with:

    EmailEvents
    | where EmailDirection == "Inbound" and SenderMailFromAddress contains "gmail.com"
    | project EmailDirection, SenderMailFromAddress, Subject
    | summarize empty_=countif(isempty(Subject)), notempty_=countif( isnotempty(Subject)) by SenderMailFromAddress, Subject

Resources