带有WHERE子句的Azure日志分析查询不生成结果

带有WHERE子句的Azure日志分析查询不生成结果,azure,azure-application-insights,azure-log-analytics,azure-data-explorer,Azure,Azure Application Insights,Azure Log Analytics,Azure Data Explorer,我正在使用Azure日志分析查询源自AppCenter诊断的Azure Application Insights中的日志条目。 在一些日志条目中,我使用自定义属性。 现在我尝试编写一个查询,只显示具有给定值的某些属性的值 我的原始查询如下所示,并生成预期结果: customEvents | where (timestamp >= datetime(2019-02-20T09:04:00.000Z) and timestamp <= datetime(2019-02-21T09:04:

我正在使用Azure日志分析查询源自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"
customEvents

|其中(时间戳>=日期时间(2019-02-20T09:04:00.000Z),时间戳=日期时间(2019-02-20T09:04:00.000Z),时间戳=日期时间(2019-02-20T09:04:00.000Z),时间戳=日期时间(2019-02-20T09:04:00.000Z)和timestamp您必须使用各种操作符,如mvexpand和extend来完成您的需求。请查找下面的示例查询。请注意,下面的示例查询只是一个示例查询,您可能需要对其进行一些调整,以使其按预期工作并获得预期输出(假设您期望customEvent的所有列在具有特定productId的特定时间戳处输出,等等)

customEvents

|where(timestamp>=datetime(2019-02-20T09:04:00.000Z)和timestamp我尝试了这个查询,但也没有结果:customEvents | where(timestamp>=datetime(2019-02-20T09:04:00.000Z)和timestamp删除最后一句话“项目时间戳、名称、customDimensions”,以查看是否有结果输出。如果有结果,请添加“项目时间戳、名称、customDimensions.Properties“到end@IvanYang谢谢。已经尝试过了,但也没有结果。我也尝试过投影customDimensions.Properties.productId,但每一行上都是空的。将使用此信息更新问题。太棒了!没想到会有这么棘手!我的最后一个查询现在看起来像这样:customEvents | where(timestamp>=datetime(2019-02-20T09:04:00.000Z)和timestamp我认为在大多数情况下可以避免mvexpand,按照允许json对象遍历的方式解析json:
T | extend d=parse_json(context_custom_metrics)| extend duration_value=d.duration.value,duration_min=d[“duration”[“min”]
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 
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
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
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"
| extend CDP_toString=parsejson(tostring(customDimensions_Properties))
| mvexpand CDP_toString
| project CDP_toString
| where CDP_toString.['productId'] == "4711";