Skip to content

Instantly share code, notes, and snippets.

@bwhaley
Created March 18, 2016 18:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bwhaley/8ba124d3f084a5604c3b to your computer and use it in GitHub Desktop.
Save bwhaley/8ba124d3f084a5604c3b to your computer and use it in GitHub Desktop.
bash script to read RDS logs
#!/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
@shiviparashar64456445
Copy link

#!/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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment