我正在使用 Azure Log Analytics 查询源自 AppCenter 诊断的 Azure Application Insights 中的日志条目。在一些日志条目中,我使用自定义属性。现在我正在尝试编写一个查询以仅显示具有给定值的某些属性的值。
我的原始查询如下所示并产生预期结果:
customEvents
| where (timestamp >= datetime(2019-02-20T09:04:00.000Z) and timestamp <= datetime(2019-02-21T09:04:00.000Z))
| top 101 by timestamp desc
| project timestamp, name, customDimensions.Properties
| where name == "Navigated to details view"
将鼠标悬停在“productId”属性上会显示一个加号,允许添加过滤条件:
选择此选项扩展了我的查询:
customEvents
| where (timestamp >= datetime(2019-02-20T09:04:00.000Z) and timestamp <= datetime(2019-02-21T09:04:00.000Z))
| top 101 by timestamp desc
| project timestamp, name, customDimensions.Properties
| where name == "Navigated to details view"
| where customDimensions_Properties.productId == 4711
到目前为止,一切都很好。如果我现在尝试运行此查询,我会收到消息“NO RESULTS FOUND”:
编辑:我还尝试将底部的 where 子句添加到第一个 where 子句
customEvents
| where (timestamp >= datetime(2019-02-20T09:04:00.000Z) and timestamp <= datetime(2019-02-21T09:04:00.000Z))
and name == "Navigated to details view"
and customDimensions.Properties.productId == 4711
| top 101 by timestamp desc
| project timestamp, name, customDimensions
可惜也没有结果。
编辑 2:我还尝试了这个查询,看看我是否可以在查询中投影 productId 属性而不将其包含在 where 子句中:
customEvents
| where (timestamp >= datetime(2019-02-20T09:04:00.000Z) and timestamp <= datetime(2019-02-21T09:04:00.000Z))
and name == "Navigated to details view"
| top 101 by timestamp desc
| project timestamp, name, customDimensions, customDimensions.Properties.productId
我有什么遗漏吗?工具是否存在问题并产生错误的查询?
感谢您的任何帮助!