Use awslogs with kubernetes 'natively' Use awslogs with kubernetes 'natively' kubernetes kubernetes

Use awslogs with kubernetes 'natively'


In this case you are using the Docker awslogs driver for logging. In which case you have to specify awslogs-stream or tag options to change the stream name from default. The tag is a bit more flexible and I think it will adjust to your requirements better, since it interprets Go template markup. This way you can have a more friendly stream name instead of the container ID.

From docker documentation:

Specify tag as an alternative to the awslogs-stream option. tag interprets Go template markup, such as {{.ID}}, {{.FullID}} or {{.Name}} docker.{{.ID}}. See the tag option documentation for details on all supported template substitutions.

When both awslogs-stream and tag are specified, the value supplied for awslogs-stream overrides the template specified with tag.

If not specified, the container ID is used as the log stream.

See tag and awslogs-stream options here:https://docs.docker.com/config/containers/logging/awslogs/