Application Insights查询问题

问题描述 投票:0回答:1

我想查询AI以查找请求表成功== false的所有跟踪条目。结果应该是与失败的InovationsId有关的所有跟踪条目。我尝试了此查询,但失败了。跟踪和请求表都有一个customDimensions ['InvocationId']字段,这是我要使用的链接。

我尝试了这些查询,但出现语法错误

    traces
    | join (requests | where success == false) on customDimensions['InvocationId']

    traces
    | join (requests | where success == false) on $left.customDimensions['InvocationId'] == 
    $right.customDimensions['InvocationId']

    traces
    | join (requests | where success == false) on traces.customDimensions['InvocationId'] == requests.customDimensions['InvocationId']

这是我得到的查询结果消息:

join:无效的实体用作联接属性。使用相等表达式时,应通过指定源$ left或$ right来使用实体。

azure azure-application-insights
1个回答
0
投票

这是因为customDimensions['InvocationId']是动态类型,您应该使用tostring()方法将其转换为字符串类型。

示例如下:

traces
| extend aa=tostring(customDimensions['InvocationId'])
| join (
       requests 
       | where success == false
       | extend aa=tostring(customDimensions['InvocationId'])
) on aa
© www.soinside.com 2019 - 2024. All rights reserved.