The stats, eventstats, and streamstats expect field names rather than expressions. To use an expression, embed the eval function. index=vs_email
[email protected]
| eval direction=case(RecipientAddress="
[email protected]", "inbound", RecipientAddress!="
[email protected]", "outbound")
| dedup MessageId
| bin _time span=1d
| eventstats count(eval(direction="inbound")) as inbound_count
| eventstats count(eval(direction="outbound")) as outbound_count
| dedup _time
| eventstats avg(inbound_count) as average_inbound_count
| eventstats avg(outbound_count) as average_outbound_count
| table inbound_count outbound_count average_inbound_count average_outbound_count
... View more