https://github.com/logzio/ecs-fluentbit-sidecar
logging sidecar container for ecs, based on fluentbit
https://github.com/logzio/ecs-fluentbit-sidecar
Last synced: 4 months ago
JSON representation
logging sidecar container for ecs, based on fluentbit
- Host: GitHub
- URL: https://github.com/logzio/ecs-fluentbit-sidecar
- Owner: logzio
- License: apache-2.0
- Created: 2024-07-17T11:35:10.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-09-16T15:46:49.000Z (9 months ago)
- Last Synced: 2025-01-05T08:56:28.243Z (5 months ago)
- Language: Makefile
- Size: 28.6 MB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
## Sending Logs from Your ECS Containers to Logz.io using fluentbit logging sidecar
To send logs from your ECS containers to Logz.io with fluentbit logging sidecar, follow these steps:* Add the Fluent Bit Sidecar Container Definition:
Add the following Fluent Bit sidecar container definition to your application task definition:```json
{
"name": "log_router",
"image": "public.ecr.aws/logzio/ecs-fluentbit-sidecar:1.1.2-amd64",
"memoryReservation": 100,
"portMappings": [],
"essential": true,
"environment": [
{
"name": "CLUSTER",
"value": "<>"
},
{
"name": "SERVICE_NAME",
"value": "<>"
},
{
"name": "LOGZIO_LOGS_TOKEN",
"value": "<>"
},
{
"name": "DEPLOYMENT_VERSION",
"value": "<>"
},
{
"name": "LOGZIO_LOGS_LISTENER",
"value": "<>"
},
{
"name": "LOGS_PATH",
"value": "<>"
}
],
"mountPoints": [
{
"sourceVolume": "<>",
"containerPath": "<>",
"readOnly": true
}
],
"dockerLabels": { "sidecar": "true" }
}
```
The Fluent Bit image is stored in AWS Public ECR and contains the Logz.io output plugin.
https://gallery.ecr.aws/logzio/ecs-fluentbit-sidecar
- amd64: `public.ecr.aws/logzio/ecs-fluentbit-sidecar:1.1.2-amd64`
- arm64: `public.ecr.aws/logzio/ecs-fluentbit-sidecar:1.1.2-arm64`Ensure you have a matching volume on your application container.
* Replace Variables
Replace the following variables with your specific Logz.io attributes:
- `<>`: Your ECS cluster name.
- `<>`: Your service name.
- `<>`: Your Logz.io logs token.
- `<>`: Your deployment version.
- `<>`: The Logz.io listener URL, for us account https://listener.logz.io:8071.
- `<>`: The path to your log files, e.g., /var/log/*.log.
- `<>`: the volume path you want to mount
- `<>`: the volume name you want to mount* After deploying your updated task definition, check your Logz.io account for incoming log data to verify that everything is set up correctly.
By following these steps, you can efficiently send logs from your ECS containers to Logz.io for better observability and monitoring.
### Adding cloudwatch logs
You can add `awslogs` `LogConfiguration` to your task definition to send logs to cloudwatch logs. Here is an example of how you can add it to your task definition.
```json
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "/ecs/<>",
"awslogs-region": "<>",
"awslogs-stream-prefix": "ecs"
}
}
```### Using firelens
To forward logs using firelens you can look at this doc https://docs.logz.io/docs/shipping/aws/aws-ecs-fargate/#alternative-configure-aws-fargate-task-manually-to-send-logs-to-logzio