0

我在我的 kusto 查询中有计算列。现在列名之一是“GET /dbs/ /colls / /pkranges”。在运行我的查询时,我遇到了这个错误

 Semantic error: Unsupported calculated column name GET /dbs/*/colls/*/pkranges Kusto

有人可以帮助动态替换列名或计算本身吗?我的查询如下

dependencies
| where operation_Id in (operation_ids)
| where timestamp > ago(7d)
| summarize duration_list=make_list_with_nulls(duration) by tostring(name), operation_Id
| extend p = pack(tostring(name), duration_list)
| summarize bag = make_bag(p) by operation_Id
| evaluate bag_unpack(bag);

提前致谢!!

4

1 回答 1

3

您可以使用其他内容替换密钥中的无效字符(*在这种情况下),如下所示,使用replace_string()

dependencies
| where operation_Id in (operation_ids)
| where timestamp > ago(7d)
| summarize duration_list=make_list_with_nulls(duration) by tostring(name), operation_Id
| extend p = pack(replace_string(name, '*', '_'), duration_list)
| summarize bag = make_bag(p) by operation_Id
| evaluate bag_unpack(bag);
于 2021-07-29T15:39:50.133 回答