Skip to content

Instantly share code, notes, and snippets.

@hackerzhut
Created July 21, 2019 06:54
Show Gist options
  • Save hackerzhut/63707beb5aef3e54791d74bd7b187252 to your computer and use it in GitHub Desktop.
Save hackerzhut/63707beb5aef3e54791d74bd7b187252 to your computer and use it in GitHub Desktop.
Cloudwatch commands from kaihendry
# Full text search
[hendry@t480s 5xx]$ cat bugzilla.sh
aws --profile uneet-dev logs filter-log-events --log-group-name bugzilla --start-time $(date -d "-1 hour" +%s000) \
--filter-pattern '"apex/ping/v1.0"'
# (faster) Query on a JSON structured log
[hendry@t480s 5xx]$ cat alambda.sh
aws --profile uneet-demo logs filter-log-events --log-group-name "/aws/lambda/alambda_simple" --start-time $(date -d "-8
hours" +%s000) \
--filter-pattern '{ $.level = "error" }' |
jq '.events[].message|fromjson'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment