Created
July 31, 2022 16:26
-
-
Save saswata-dutta/a396de5e197807b025542be660361ec5 to your computer and use it in GitHub Desktop.
fetch cloudwatch logs
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
aws logs filter-log-events \ | |
--log-group-name '/aws/lambda/my-lambda' \ | |
--log-stream-name-prefix '2022/07/31/[$LATEST]' \ | |
--start-time 1659247200000 \ | |
--end-time 1659254400000 \ | |
--filter-pattern '"EVENT ::"' | |
# [--starting-token <value>] | |
awslogs get '/aws/lambda/my-lambda' \ | |
--query=message \ | |
--filter-pattern '"EVENT ::"' \ | |
--start='2h' | sed 's/^.*EVENT :: //' > logs2h |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment