A Docker-based Fluentd setup that forwards logs to Amazon S3.
All configuration is done through environment variables, which can be passed directly to the Docker container.
Variable | Description | Default |
---|---|---|
FLUENTD_PORT |
Port for Fluentd to listen on | 24224 |
FLUENTD_BIND |
IP address to bind Fluentd to | 0.0.0.0 |
AWS_ACCESS_KEY_ID |
AWS access key ID | - |
AWS_SECRET_ACCESS_KEY |
AWS secret access key | - |
S3_BUCKET |
S3 bucket name | - |
S3_REGION |
AWS region for S3 | - |
S3_PATH |
Path prefix in the S3 bucket | logs/ |
BUFFER_PATH |
Path for Fluentd buffer files | /var/log/fluentd |
TIME_SLICE_FORMAT |
Format for time slices | %Y%m%d |
TIME_SLICE_WAIT |
Wait time before uploading time slices | 15m |
-
Start the Fluentd container:
docker-compose up -d
-
Send logs to Fluentd:
# Example using Docker's fluentd logging driver docker run --log-driver=fluentd roura/fluentd-s3