Created
April 23, 2017 05:08
-
-
Save jacklund/f21e2b1d6f5cdc93cccf17b5eaaf7d78 to your computer and use it in GitHub Desktop.
Script to get logs from an AWS instance
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
#! /bin/bash | |
set -o errexit | |
set -o nounset | |
usage() { | |
echo "Usage: $0 REGION INSTANCE-ID" | |
} | |
if [ $# -lt 2 ]; then | |
usage | |
exit 1 | |
fi | |
aws ec2 get-console-output --region $1 --instance-id $2 | jq .Output | xargs -0 echo print | xargs -0 python -c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment