Last active
March 30, 2017 08:31
-
-
Save ejoubaud/bb45283316106393710f4ae607a5ffb9 to your computer and use it in GitHub Desktop.
Fetch all available RDS slow logs into single file
This file contains hidden or 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
aws-vault exec customer -- aws rds describe-db-log-files --db-instance-identifier market-database-clustercluster-16apkpdp1bgkx-us-east-1a --region us-east-1 --query 'DescribeDBLogFiles[].LogFileName' --output text | tr '\t' '\n' | grep slowquery | while read file; do aws-vault exec customer -- aws rds download-db-log-file-portion --db-instance-identifier market-database-clustercluster-16apkpdp1bgkx-us-east-1a --region us-east-1 --log-file-name $file --output text >> slowlogs.log; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment