def lambda_handler(event, context):
<EOL>event = json.loads(gzip.GzipFile(fileobj=StringIO(event['<STR_LIT>']['<STR_LIT:data>'].decode('<STR_LIT>'))).read())<EOL>account = event['<STR_LIT>']<EOL>region = context.invoked_function_arn.split('<STR_LIT::>', <NUM_LIT:4>)[<NUM_LIT:3>]<EOL>log_events = event['<STR_LIT>']<EOL>for log_event in log_events:<EOL><INDENT>message = json.loads(log_event['<STR_LIT:message>'])<EOL>ts = log_event['<STR_LIT>'] / <NUM_LIT:1000><EOL>_process_rds_enhanced_monitoring_message(ts, message, account, region)<EOL><DEDENT>stats.flush()<EOL>return {'<STR_LIT>': '<STR_LIT:OK>'}<EOL>
Process a RDS enhenced monitoring DATA_MESSAGE,
        coming from CLOUDWATCH LOGS