Skip to content

Cloud CLI: Logs

Cloud CLI commands for logs (tags: #logs #cloudwatch).

Index
3 items

AWS1

AWS: Tail a CloudWatch log group

Safe

Stream CloudWatch Logs like tail -f. Add --filter-pattern "ERROR" to narrow.

aws logs tail <log-group> --follow --since 15m --region <region>
What each part does
  1. aws logs tailprint log events from a CloudWatch log group
  2. <log-group>the group name, e.g. /aws/lambda/orders-api
  3. --followkeep streaming new events (like tail -f)
  4. --since 15mstart 15 minutes back (s, m, h, d, w)
  5. --region <region>region of the log group, overrides the profile default
Example
$ aws logs tail /aws/lambda/orders-api --follow --since 15m --region eu-west-1

Also known as: cloudwatch logs · aws logs tail · lambda logs

Azure1

Azure: Stream App Service logs

Safe

Live application and web server logs from an App Service.

az webapp log tail -g <resource-group> -n <app>
What each part does
  1. az webapp log tailstream live logs from an App Service app
  2. -g <resource-group>resource group of the app
  3. -n <app>the web app name; app logging must be enabled (az webapp log config)

Also known as: webapp logs · app service logs

GCP1

GCP: Read recent error logs

Safe

Errors from Cloud Logging in the last hour across the project.

gcloud logging read 'severity>=ERROR' --freshness=1h --limit=50
What each part does
  1. gcloud logging readquery Cloud Logging
  2. 'severity>=ERROR'filter: ERROR, CRITICAL, ALERT, EMERGENCY
  3. --freshness=1honly entries from the last hour
  4. --limit=50return at most 50 entries

Also known as: stackdriver · cloud logging

My DevOps Playbook by Angelo John Calleja

New runbook

GitHub not connected

Saving is handled by the site: the GitHub token is stored in Cloudflare, not in your browser. Enter the editor password (the EDITOR_PASSWORD secret) to unlock saving in this browser.

Saving commits to gelogrammer/My_DevOps_Playbook. Create a fine-grained token with access to only this repo andContents: Read and write, then paste it here. It is stored only in this browser.

src/content/docs/…