Queries for the AppPlatformLogsforSpring table
For information on using these queries in the Azure portal, see Log Analytics tutorial. For the REST API, see Query.
Show the application logs which contain the "error" or "exception" terms
Show the application logs which contain the "error" or "exception" terms in the last hour.
// 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
Show the error and exception number of each application
Show a pie chart of the number of the logs containing the "error" or "exception" terms in the last 24 hours, per application.
// 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