Amazon-ecs-agent: awslogs-stream option not supported by the awslogs driver

Created on 4 Jun 2016  路  16Comments  路  Source: aws/amazon-ecs-agent

Task definitions cannot use the awslogs-stream option when using the awslogs driver :
Log driver awslogs disallows options: awslogs-stream

The ability to configure the logstream name was mentioned several times already ( https://github.com/aws/amazon-ecs-agent/pull/251, https://github.com/aws/amazon-ecs-agent/issues/200 , https://github.com/aws/amazon-ecs-agent/issues/379 ) but I could not find an open issue capturing this need.

It would be great to be able to use string interpolation to customize logstream names while still guaranteeing their uniqueness inside a Loggroup.

eg something like

 "logConfiguration": {
        "logDriver": "awslogs",
        "options": {
          "awslogs-group": "loggroup",
          "awslogs-region": "us-east-1",
          "awslogs-stream": "logstream-docker-webapp-{CONTAINER_ID}",
        }
      }

This probably also relates to https://github.com/docker/docker/issues/17747

kinfeature request

Most helpful comment

When I do this developers tell me it is difficult to search the logs. They would rather see all the streams in one place. Is it possible to support both awslogs_stream and awslogs_stream_prefix?

All 16 comments

I would love to see support for this as well

+1

+1
https://docs.docker.com/engine/admin/logging/awslogs/ says it should support but no luck.

+1, been waiting for this every since I stopped waiting for awslogs support

I'm also waiting for this for a long time. Its extremely hard to read the logs with randomly assigned steam names

+1

+1

This seems like a crazy oversight, in a multi container setup with everything going the same group (as is logical,) it's impossible to decipher what's what without having to log into the instance to figure out the container IDs first.

+1

+1

+1

+1

+1

+1

Today we launched support for awslogs-stream-prefix, which lets you name your log stream that includes the taskID so that it's easy to go from a task to the log stream and from the log stream to the task. See the documentation for more information. http://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_awslogs.html

Does the prefix support variables like "{{.ImageID}}/{{.ID}}"? I'd like to get the ECS instance ID in the prefix as well.

When I do this developers tell me it is difficult to search the logs. They would rather see all the streams in one place. Is it possible to support both awslogs_stream and awslogs_stream_prefix?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aaithal picture aaithal  路  3Comments

PettitWesley picture PettitWesley  路  5Comments

taktakpeops picture taktakpeops  路  4Comments

leonblueconic picture leonblueconic  路  3Comments

cjbottaro picture cjbottaro  路  4Comments