Skip to main content

Push logs to S3

Project description

Install

pip install s3logs

Usage

s3logs config.conf

Where config.conf can use that structure:

[S3]
access_key = <S3_KEY>
secret_key = <S3_SECRET_KEY>
host = <s3.example.com>
bucket = <bucket_name>
chunk_size = <bytes, default=52428800>

[logs]

suffix = .0.gz
directory = /var/log/nginx/

[map]

example.com-access.log = example/access
example.com-error.log = example/error
mysite.me.access.log = mysite/access

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

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

example.com-access.log example.com-access.log.0.gz example.com-access.log.1.gz example.com-error.log example.com-error.log.0.gz example.com-error.log.1.gz mysite.me.access.log mysite.me.access.log.0.gz mysite.me.error.log mysite.me.error.log.0.gz

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

example/access/2015-12-09.gz example/error/2015-12-09.gz mysite/access/2015-12-09.gz

Because we have not explain how maps mysite.me.error.log.0.gz - it was skipped.

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.0.tar.gz (3.2 kB view details)

Uploaded Source

File details

Details for the file s3logs-1.0.tar.gz.

File metadata

  • Download URL: s3logs-1.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for s3logs-1.0.tar.gz
Algorithm Hash digest
SHA256 9a75e5b2443bdfefdae9c7ae9f5253ef239064ee7f77399a213d1133f18d275f
MD5 7097898b4a8c42eb757fece2d2ec79fb
BLAKE2b-256 837a9839f50f38076232590ee1d306d8490ebcca9134afe76347260d8426257f

See more details on using hashes here.

Supported by

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