Kusto:运行查询以获取唯一 ID 号列表

Che*_*rbo 5 azure-data-explorer

我是一名 C 程序员,也是 Kusto 的新手。我正在运行 Kusto 查询,它为我提供了直接搜索唯一 ID 号的结果。如何运行该查询来获取 ID 号列表。在 CI 中,将使用 for 循环来处理列表数组中的项目范围,但我不知道如何在 Kusto 中转换该逻辑。

询问:

let startdate = ago(5d); let enddate = ago(1m);
DataBase
| where messageType != "Beacon" 
| where timestamp between (startdate..enddate)   
| where uniqueId == "26ca68"
| project uniqueId, timestamp
Run Code Online (Sandbox Code Playgroud)

我希望运行上述查询来获取 25 个唯一 ID 号的列表。谢谢。

Yon*_*i L 7

您可以使用in()运算符:https ://learn.microsoft.com/en-us/azure/kusto/query/inoperator

例如:

let IDs = dynamic(["abc", "def", "ghi"]); // replace/add IDs
let startdate = ago(5d);
let enddate = ago(1m);
DataBase
| where messageType != "Beacon" 
| where timestamp between (startdate..enddate)   
| where uniqueId in (IDs) // <----
| project uniqueId, timestamp
Run Code Online (Sandbox Code Playgroud)