AppPlatformLogsforSpring 表的查询

有关在 Azure 门户中使用这些查询的信息,请参阅 Log Analytics 教程。 有关 REST API,请参阅查询

显示包含“error”或“exception”一词的应用程序日志

显示过去一小时内包含“error”或“exception”一词的应用程序日志。

// To create an alert for this query, click '+ New alert rule'
AppPlatformLogsforSpring
| where TimeGenerated > ago(1h)
| where Log contains "error" or Log contains "exception"
| project TimeGenerated , ServiceName , AppName , InstanceName , Log , _ResourceId 

显示每个应用程序的错误和异常数

按应用程序显示过去 24 小时内包含“error”或“exception”一词的日志数的饼图。

// To create an alert for this query, click '+ New alert rule'
AppPlatformLogsforSpring 
| where TimeGenerated > ago(24h)
| where Log contains "error" or Log contains "exception"
| extend FullAppName = strcat(ServiceName, "/", AppName)
| summarize count_per_app = count() by FullAppName, ServiceName, AppName, _ResourceId
| sort by count_per_app desc 
| render piechart