Skip to main content

Push logs to S3

Project description

Get files from directory by mask and push them to S3


pip install s3logs


s3logs config.conf

Where config.conf can use that structure:

access_key = <S3_KEY>
secret_key = <S3_SECRET_KEY>
host = <>
bucket = <bucket_name>
chunk_size = <bytes, default=52428800>


suffix = .gz
key_suffix = .gz
directory = /var/log/nginx/
depth = 30

[map] = example/access = example/error = mysite/access

When it used with that config, script takes all files in directory /var/log/nginx/, filter only those, which ends with .gz and send it to S3, according to map.

For example, /var/log/nginx now consists of:

So, if today is 9 December 2015, and your hostname is node1, on your S3 <bucket_name> would be those keys:


Because we have not explain how maps - it would be skipped.

Script also checks whether file exists in S3 and push only those, which are not.

Parameter depth stops pushing, if filename is older, than .<depth>.gz

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

s3logs-1.8.tar.gz (3.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page