I am using AWS Firelens to send logs to Cloudwatch. Firelens sends these below fields by default to fluentbit container along with the log message.
{
"container_id": "asdfasdfasdfadsf",
"container_name": "/ecs-microservice-ms-233-microservice-ms-e8e2e9e3b3c9e5e02100",
"ecs_cluster": "arn:aws:ecs:us-east-1:1234:cluster/app-microservices",
"ecs_task_arn": "arn:aws:ecs:us-east-1:1234:task/asdf",
"ecs_task_definition": "microservice-ms:233"
}
I want to do something like this in output section,
[OUTPUT]
Name cloudwatch
Match **
region us-east-1
log_group_name /ecs/${microservice}
log_stream_prefix ${TAG}
auto_create_group true
Where, log group name should be the ecs service name. But I don't have any fields with service name. ecs_task_definition is the closest but it has task revision number.
Is it possible to achieve what I am trying to do?