<p>I'm telling containerd to use awslogs using <code>/etc/docker/daemon.json</code> file as proposed in the documentation in <a href="https://docs.docker.com/config/containers/logging/awslogs/" rel="nofollow noreferrer">https://docs.docker.com/config/containers/logging/awslogs/</a></p>

<p>By default, the aws stream name is set to a randomly generated container-id which is meaningless when you list the streams inside a group.</p>

<p>awslogs driver has an option to set awslogs-stream to a specific name but that won't satisfy my needs since I want different containers to use different streams.</p>

<p>I guess what I want to do is to tell docker to compose the stream-id from the image name and the container-id, but I couldn't find an option for that.</p>

<p>Theoretically, I can set the stream name directly in the <code>docker run</code> command, but that is not good enough because I use Kubernetes to launch those containers so I'm not sure how to set the stream_name from the application yml file.</p>

<p>Any ideas how to accomplish my needs?</p>

Eytan Naim
<p>You're correct, there's no sign of <code>--log-opt</code> being implemented into Kubernetes, since dockerd is deprecated.</p>

<p>Instead of specifying the <code>awslogs-stream</code> have you tried to set a <code>tag</code>?</p>

<ul>
<li>Check this <strong><a href="https://stackoverflow.com/questions/55609398/use-awslogs-with-kubernetes-natively">Use Awslogs With Kubernetes 'Natively'</a></strong> as it may fit perfectly to your needs.</li>
</ul>

<p>From Docker documentation link you posted:</p>

<blockquote>
  <p>Specify  <code>tag</code>  as an alternative to the  <code>awslogs-stream</code>  option.  <code>tag</code>  interprets Go template markup, such as  <code>{{.ID}}</code>,  <code>{{.FullID}}</code>  or  <code>{{.Name}}</code>  <code>docker.{{.ID}}</code>.
  See the  <a href="https://docs.docker.com/config/containers/logging/log_tags/" rel="nofollow noreferrer">tag option documentation</a>  for details on all supported template substitutions.</p>
</blockquote>

<p><em>The other viable approach is using a sidecar container daemon to process the logs and then forward to awslogs but <code>tag</code> is a cleaner, simplier solution.</em></p>

<p>Here's the process with the fluentd: </p>

<blockquote>
  <p><strong><a href="https://stackoverflow.com/questions/46469076/how-to-send-kubernetes-logs-to-aws-cloudwatch">How to Send Kubernetes Logs to AWS Cloudwatch</a></strong></p>
</blockquote>
