Skip to main content

S3 Logs Pusher

https://img.shields.io/pypi/v/s3logs.svg?style=flat-square https://img.shields.io/pypi/dm/s3logs.svg?style=flat-square

Get files from directory by mask and push them to S3

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
key_suffix = .gz
directory = /var/log/nginx/
filename = <filename, default=(yesterday as yyyy-mm-dd)>

[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, and your hostname is node1, on your S3 <bucket_name> would be those keys:

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

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

If there was filename=newfile option in config.conf, keys in S3 would look like node1/example/access/newfile.gz

Metadata

Release files for s3logs 1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for s3logs 1.4
File Size Uploaded
s3logs-1.4.tar.gz 3.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for s3logs 1.4
File Interpreter ABI Platform
s3logs-1.4.macosx-10.11-x86_64.tar.gz Details

Total release size: 6.1 kB

Release files / s3logs-1.4.tar.gz

Download URL s3logs-1.4.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e0671e8740b90b298492d1143a229bdd4267164774b20a21e83c656b6129369e
BLAKE2b-256 checksum
How to use checksums
19a9d5143eef2dbc3a36fc84ccb9d88c815d998f616b9a13098e025deb943895
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / s3logs-1.4.macosx-10.11-x86_64.tar.gz

Download URL s3logs-1.4.macosx-10.11-x86_64.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5cd691260978599d9bb8c07c83ff8168ee5ab80acd674a435dbb1b625a6a901d
BLAKE2b-256 checksum
How to use checksums
e8782fa0ec41a8128b21fc4a334c4ce4bd2540f4d4ddda0dfdf72103f60cbcc5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

1.8

1 release file

1.7

1 release file

1.6

2 release files

1.5

2 release files

This release

1.4 This release

2 release files

1.3

1 release file

1.2

1 release file

1.1

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page