共用方式為


AppPlatformLogsforSpring 數據表的查詢

顯示包含「錯誤」或「例外狀況」詞彙的應用程式記錄

顯示應用程式記錄,其中包含過去一小時內的「錯誤」或「例外狀況」詞彙。

// 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 小時內包含「錯誤」或「例外狀況」詞彙之記錄數目的餅圖。

// 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