Skip to content

Instantly share code, notes, and snippets.

@gnomeria
Last active November 29, 2019 08:49
Show Gist options
  • Save gnomeria/9e54fc43167ea04ce213cad5347c2205 to your computer and use it in GitHub Desktop.
Save gnomeria/9e54fc43167ea04ce213cad5347c2205 to your computer and use it in GitHub Desktop.
AWS Cloudwatch Query Snippets
# Parse api-gateway log pattern for space separated message cloudwatch
fields @timestamp
| parse '* - - "*" * * * - * * * *' as ip, timestamp, method, route, http, req_id, req_latency, code, req_size
| filter code = 200
| sort @timestamp desc
| limit 20
# Parse with filter on field with regex
fields @timestamp
| parse '* - - "*" * * * - * * * *' as ip, timestamp, method, route, http, req_id, req_latency, code, req_size
| filter code like /5\d\d/
| sort @timestamp desc
| limit 20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment