KQL - Joining 2 tables sing Equality by Value

406 views Asked by At

I am attempting to join two tables in KQL within Microsoft Defender.

These tables don't have matching columns however they do have matching fields.

LeftTable: EmailEvents Field: RecipientEmailAddress

RightTable: IdentityInfo Field: AccountUpn

The query I am using is as follows

EmailEvents
| where EmailDirection == "Inbound"
| where Subject == "invoice" or SenderFromAddress == "[email protected]"
| project RecipientEmailAddress, Subject, InternetMessageId, SenderFromAddress
| join kind=inner (IdentityInfo 
| distinct AccountUpn, AccountDisplayName, JobTitle , Department, City, Country) 
on $left.RecipientEmailAddress -- $right.AccountUpn

I am seeing the error

Semantic error Error message join: only column entities or equality expressions are allowed in this context. How to resolve Fix semantic errors in your query

Can someone assist I am not sure where I am going wrong here.

1

There are 1 answers

0
Yoni L. On

try replacing this:

on $left.RecipientEmailAddress -- $right.AccountUpn

with this:

on $left.RecipientEmailAddress == $right.AccountUpn