Created
August 13, 2018 19:16
-
-
Save bushong1/9754c2ad9ed4c0348436252a1e8cc04d to your computer and use it in GitHub Desktop.
Wrapper for awslogs to simplify prod vs nonprod
This file contains 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
function app-logs() { | |
if [ -z $1 ] || [ -z $2 ]; then | |
echo "usage: app-logs <env> <service> [<awslogs params>]" | |
return 1 | |
fi | |
if [ "$1" = "production" ] || [ "$1" = "staging" ]; then | |
ACCOUNT=prod | |
else | |
ACCOUNT=default | |
fi | |
awslogs get --profile "${ACCOUNT}" "${1}-${2}" $(echo $@ | cut -s -d' ' -f3-) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment