Skip to content

Instantly share code, notes, and snippets.

@pearsonhenri
pearsonhenri / consolidate_logs.py
Created October 1, 2022 13:20
AWS S3 CloudWatch log export consolidation
from io import BytesIO
from gzip import GzipFile
import boto3
# assumes AWS authentication via ~/.aws/credentials, environment variables, or some other mechanism
s3_resource = boto3.resource('s3')
s3_client = boto3.client('s3') # yes, we really do want both