Last active
April 27, 2018 22:07
-
-
Save msato0731/ad88d5c6e045cb6c2367a6cb996753e5 to your computer and use it in GitHub Desktop.
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
import boto3 | |
import datetime | |
def lambda_handler(event, context): | |
d = datetime.datetime.now() | |
date = d.strftime("%Y-%m-%d") | |
logs = 'error/postgresql.log.' + date | |
rds_client = boto3.client('rds') | |
rds_response = rds_client.download_db_log_file_portion( | |
DBInstanceIdentifier='hostname', | |
LogFileName=logs | |
) | |
print(rds_response) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment