如何在 KQL 中正确使用 in for 字符串列表

How to correctly use in for string list in KQL

以下代码有效

let names = dynamic(['Windows Installer', 'Software Protection']);

ConfigurationChange
| where Computer like "SRV"
| where SvcPreviousState  == "Running"
| where SvcState == "Stopped"
// | where SvcDisplayName in (names)
| order by TimeGenerated

如评论所述,我只想检查 SvcDisplayName 的列表。

根据文档,这应该有效,但确实有问题

: Failed to resolve table or column or scalar expression named 'names'

如何正确使用 in 和 SvcDisplayName 列表?

空白行被视为查询之间的分隔符,除非您select执行整个代码。
请参阅下面的屏幕截图。

Select 执行的全部代码。
=> 有效查询

将光标放在要执行的查询上。
let语句后没有空行。
=> 有效查询

将光标放在要执行的查询上。
let 语句后有一个空行。
=> 无效查询

请注意查询是如何用浅蓝色标记的,而不是 let 语句