Created
March 18, 2016 18:50
-
-
Save bwhaley/8ba124d3f084a5604c3b to your computer and use it in GitHub Desktop.
bash script to read RDS logs
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
#!/usr/bin/env/bash | |
$db = $1 | |
for logfile in $(aws rds describe-db-log-files --db-instance-identifier $db | jq '.DescribeDBLogFiles|.[]|.LogFileName') | |
do | |
aws rds download-db-log-file-portion --db-instance-identifier $db --log-file-name ${logfile} --starting-token 0 --output text >> $db-logs.txt | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#!/bin/bash
for x in $(aws rds describe-db-log-files --db-instance-identifier vv-qa-pgdb | jq '.DescribeDBLogFiles[].LogFileName')
do
echo "Downloading ${x}"
aws rds download-db-log-file-portion --db-instance-identifier vv-qa-pgdb --log-file-name $x --output text
done
When I am running this script I'm getting 'Downloading "LogFileName"' and 'False' in the output. Please help!