如何用KQL过滤含至少3元素子数组的JSON数组行?
解决方法
完整的KQL查询语句如下:
traces | where message has "Items per slot" | extend items = parse_json(customDimensions["ItemsPerSlot"]) | where array_any(items, (x) => array_length(x) >= 3)
说明:
array_any()函数用于检查数组中是否存在至少一个元素满足指定条件- 这里通过匿名函数
(x) => array_length(x) >= 3定义判断规则:遍历items里的每个子数组x,检查其元素数量是否≥3 - 只要有一个子数组符合条件,该行就会被筛选出来
内容的提问来源于stack exchange,提问作者nrofis
相关产品推荐
相关产品推荐

