Azure Application Insights | KQL |获取异常细节



我们使用Azure应用程序Insights进行错误记录。我是KQL的新手,并试图从内置的"customdimensions"中获取自定义属性。列,

<customDimensions&quot;列>

{
"File Name":"Sample File 1",
"Correlation ID":"e33a8d45-0566-4bf2-94f8-54a6fec29bff",
"Error List":"[
{
"Function Name":"Sample Function 1",
"Code":"#231256#"
},
{
"Function Name":"Sample-Function-2",
"Code":"#231258#"
},
]"
}

预期输出

文件名相关性ID函数名代码
示例文件1e33a8d45-0566-4bf2-94f8-54a6fec29bff示例函数1#231256#
样本文件1e33a8d45-0566-4bf2-94f8-54a6fec29bffSample- function -2#231258#

mv-expand operator

datatable(ErrorDetails:dynamic)
[
dynamic({
"File Name":"Sample File 1",
"Correlation ID":"e33a8d45-0566-4bf2-94f8-54a6fec29bff",
"Error List": [{
"Function Name":"Sample Function 1",
"Code":"#231256#"
},
{
"Function Name":"Sample-Function-2",
"Code":"#231258#"
}
]
})
]
| mv-expand EL = ErrorDetails.["Error List"]
| project ["File Name"] = ErrorDetails["File Name"], ["Correlation ID"] = ErrorDetails["Correlation ID"], ["Function Name"] = EL["Function Name"], ["Code"] = EL["Code"]
文件名相关性ID函数名代码
示例文件1e33a8d45-0566-4bf2-94f8-54a6fec29bff示例函数1#231256#
样本文件1e33a8d45-0566-4bf2-94f8-54a6fec29bffSample- function -2#231258#

如何使用KQL实现上述输出?

  • 下面是可用于获取相关id的示例命令和函数名在列。
customEvents
| extend Org = tostring(customDimensions.correlationID)
  • 参考文档

相关内容

  • 没有找到相关文章

最新更新