Skip to content

Instantly share code, notes, and snippets.

@jacklund
Created April 23, 2017 05:08
Show Gist options
  • Save jacklund/f21e2b1d6f5cdc93cccf17b5eaaf7d78 to your computer and use it in GitHub Desktop.
Save jacklund/f21e2b1d6f5cdc93cccf17b5eaaf7d78 to your computer and use it in GitHub Desktop.
Script to get logs from an AWS instance
#! /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