Skip to content

Monitoring & logging: Logs

Monitoring & logging commands for logs (tags: #logs #cloudwatch).

Index
1 items

Elasticsearch: Search recent error logs

Safe

Last 20 error-level documents. Change the field to match your log schema.

curl -s "<es-url>/<index-pattern>/_search?q=level:error&size=20&sort=@timestamp:desc&pretty"
What each part does
  1. curl -sHTTP request, quiet
  2. <index-pattern>/_searchsearch across matching indices, e.g. logs-*
  3. q=level:errorLucene query string: documents where level is error
  4. size=20return 20 hits
  5. sort=@timestamp:descnewest first
  6. prettyindent the JSON

Also known as: kibana search · elk logs

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