Created
May 8, 2019 06:06
-
-
Save kaihendry/21597f3c0f86df6636945e0e71f73e6c to your computer and use it in GitHub Desktop.
CloudWatch examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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