import boto3 client = boto3.client('rds') response = client.describe_db_instances() instances = response.get('DBInstances') for instance in instances: dbidentifier = instance.get('DBInstanceIdentifier') response = client.describe_db_log_files(DBInstanceIdentifier=dbidentifier) logfiles = response.get('DescribeDBLogFiles') for logfile in logfiles: logFileName = logfile.get('LogFileName') print dbidentifier + "\t" + logFileName C:\temp>python rds_logs.py testdbinstance error/postgres.log testdbinstance error/postgresql.log.2015-10-25-08 testdbinstance error/postgresql.log.2015-10-25-09 testdbinstance error/postgresql.log.2015-10-25-10 testdbinstance error/postgresql.log.2015-10-25-11 testdbinstance error/postgresql.log.2015-10-25-12 testdbinstance error/postgresql.log.2015-10-25-13 testmysql error/mysql-error-running.log … Continue reading RDS Log files
↧