Skip to content

Instantly share code, notes, and snippets.

@bushong1
Created August 13, 2018 19:16
Show Gist options
  • Save bushong1/9754c2ad9ed4c0348436252a1e8cc04d to your computer and use it in GitHub Desktop.
Save bushong1/9754c2ad9ed4c0348436252a1e8cc04d to your computer and use it in GitHub Desktop.
Wrapper for awslogs to simplify prod vs nonprod
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