Kusto 设置查询的变量输出

Dr *_*izo 5 kql

希望定义一个变量来保存查询的输出,然后从中查询跟踪。像这样的东西:

let start=datetime("2020-10-07T15:01:00.000Z");
let end=datetime("2020-10-09T13:20:00.000Z");
let timeGrain=1h;
let dataset = dependencies
| where timestamp > start and timestamp < end and ['type'] == 'HTTP' and success == false
| where name contains "mgw/capture"
| project operation_ParentId
traces
| join kind=inner(dataset) on operation_ParentId
Run Code Online (Sandbox Code Playgroud)

这可能吗?

Sla*_*k N 1

是的,有可能,而且你几乎猜对了,你只是;在相关声明的末尾遗漏了一个let

尝试这个:

let start=datetime("2020-10-07T15:01:00.000Z");
let end=datetime("2020-10-09T13:20:00.000Z");
let timeGrain=1h;
let dataset = dependencies
| where timestamp > start and timestamp < end and ['type'] == 'HTTP' and success == false
| where name contains "mgw/capture"
| project operation_ParentId;
traces
| join kind=inner(dataset) on operation_ParentId
Run Code Online (Sandbox Code Playgroud)