如何从 Kusto 的列表 A 中排除列表 B?

How do I exclude List B from List A in Kusto?

我想大致了解最近的特别活动,那些已经有名为 'Skip' 的评论的活动需要从列表 A 中排除。由于评论是一个数组,我不能简单地将所有内容都放在一个带有 where 子句的查询(它不会处理评论,因为它只包含值:'[]')。 我如何合并这两个表(显示列表 A 中的所有内容,但列表 B 中的除外)?

// List A: 显示所有在 1 小时前创建的事件 特别活动 |其中 TimeGenerated < ago(1h) |不同的唯一编号 |项目唯一编号

// 列表 B:不添加包含 'skip' 的列表 特别活动 | mvexpand parsejson(评论) |扩展 commentMsg = Comments.message |其中 commentMsg 包含 'SKIP' |不同的唯一编号 |项目唯一编号

如果我对你的问题理解正确,你可以使用 !in() 运算符或反 join.

例如:

let list_a = 
   SpecialEvent 
   | where TimeGenerated < ago(1h) 
   | distinct uniqueNumber
;
SpecialEvent 
| where uniqueNumber !in(list_a)
| mv-expand parsejson(Comments) // you could also use 'mv-apply' and perform the filters on 'SKIP' under that scope
| extend commentMsg = Comments.message
| where commentMsg contains 'SKIP'
| distinct uniqueNumber