首页 > 解决方案 > Azure Log Analytics - 加入失败 - 数据类型不一致

问题描述

我对 Azure 和查询语言非常陌生。我创建了一些似乎有效的警报和查询,但我试图每小时扫描一次以查找特定的 http 错误,并用描述和代码显示它们。

我使用了数据表的连接,但是当我运行查询时,连接失败。

Inconsistent data types for the join keys (responseCode_d, responseCode_d) (R64, I32)

responseCode_d 是根据 Azure Analytics 查询架构的数字,我在数据表中将其声明为整数。 responseCode_d 架构

下面是查询。

let codes = datatable(responseCode_d:int, description:string)
        [        400, "Endpoint - Not found",
                 500, "Internal server error",
                 415, "Unsupported Media"      
        ];
AzureDiagnostics
| join kind = inner
    codes on responseCode_d
| where responseCode_d == 500 or responseCode_d == 415 or responseCode_d == 400
| where TimeGenerated >= ago(1h)
| summarize count(responseCode_d) by description

标签: azurejoinloggingtypesanalytics

解决方案


错误消息给出了提示。(R64, I32) 表列类型 (R64) 与您为表 responseCode_d:int (I32) 指定的类型不匹配。

将数据表(responseCode_d:int,description:string)更改为数据表(responseCode_d:double,description:string)


推荐阅读