skip to content
Alvin Lucillo

Querying Log Analytics for errors

/ 1 min read

As a continuation of yesterday’s entry, this command below filters logs that have error.

az monitor log-analytics query -w $WORKSPACE_ID \
    --analytics-query "ContainerAppConsoleLogs_CL | where ContainerAppName_s == '$CONTAINER_APP_NAME' and Log_s contains 'error' | project TimeGenerated, Log_s | order by TimeGenerated desc | take 20" \
    -o table
Log_s                                                                     TableName      TimeGenerated
------------------------------------------------------------------------  -------------  ----------------------------
[2026-08-24 10:04:09 +0000] [7] [ERROR] Worker (pid:8) was sent SIGTERM!  PrimaryResult  2026-08-24T10:04:10.7729608Z
[2026-08-24 10:00:05 +0000] [7] [ERROR] Worker (pid:8) was sent SIGTERM!  PrimaryResult  2026-08-24T10:00:06.590624Z