查找两个表之间缺失的值

Find the values missing between two tables

kql 的新手。有一个非常基本的问题。

说 - 我有两个表 - Table1,Table2 其中有一列名为 id。

我要查找的是查询 - 查找表 1 中存在但表 2 中不存在的 ID?

我看到了 set_differnce,我被卡住的地方是生成要传递给它的数组。

提前致谢。

您可以考虑使用 leftanti/rightanti join!in.

示例:

这个 returns 一个 table 有一个列 x,值 1,4,7,22,25,28

let T1 = range x from 1 to 30 step 3;
let T2 = range y from 10 to 20 step 1;
T1
| join kind=leftanti T2 on $left.x == $right.y

这也是:

let T1 = range x from 1 to 30 step 3;
let T2 = range y from 10 to 20 step 1;
T1
| where x !in((T2 | project y))