Application Insights 项目 severityLevel 的字面值

Application Insights project literal value of severityLevel

有没有办法在 Application Insights 查询中投影 severityLevel 的文字值?

考虑以下查询:

union
customEvents,
dependencies,
exceptions,
performanceCounters,
traces
| order by timestamp desc
| project timestamp, operation_Name, itemType, severityLevel, message = strcat(name, message, outerMessage), customDimensions, ['details']

在输出中,severityLevel 值是数字,我想要符合 SeverityLevel Enum definition

的等效描述值
  • 我能够得到 severityLevel 描述值。
  • 使用下面的查询片段
union
customEvents,
dependencies,
exceptions,
performanceCounters,
traces
| order by timestamp desc
| project timestamp, operation_Name, itemType, severityLevel, message = strcat(name, message, outerMessage), customDimensions, ['details']

| extend severityLevel = case(severityLevel == 0, "Verbose", 
                       severityLevel == 1, "Information",
                       severityLevel == 2, "Warning", 
                       severityLevel == 3, "Error", 
                       severityLevel == 4, "Critical",                      
                       "-")