# Add\_docker\_metadata is not able to pick container.labels.com\_amazonaws\_ecs\_container-name for a short living containers

**URL:** <https://discuss.elastic.co/t/add-docker-metadata-is-not-able-to-pick-container-labels-com-amazonaws-ecs-container-name-for-a-short-living-containers/335196>\
**Category:** Beats\
**Tags:** docker, filebeat\
**Created:** [June 5, 2023, 9:32am UTC](https://discuss.elastic.co/t/add-docker-metadata-is-not-able-to-pick-container-labels-com-amazonaws-ecs-container-name-for-a-short-living-containers/335196 "2023-06-05T09:32:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maciej\_Piasecki](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maciej_piasecki/32/121836_2.png) [@Maciej\_Piasecki](https://discuss.elastic.co/u/Maciej_Piasecki)\
**Post date:** [June 5, 2023, 9:32am UTC](https://discuss.elastic.co/t/add-docker-metadata-is-not-able-to-pick-container-labels-com-amazonaws-ecs-container-name-for-a-short-living-containers/335196/1 "2023-06-05T09:32:40Z")

</div>

Hi,  
I am running some short living containers and I noticed that add\_docker\_metadata is not able to access container.labels.com\_amazonaws\_ecs\_container-name at a random frequency.  
I am using a rename like this:

```auto
  - rename:
      fields:
      - from: "container.labels.com_amazonaws_ecs_container-name"
        to: "docker_container_name"

```

Sometimes it works and sometimes in the log I can observe:  
"Failed to rename fields in processor: could not fetch value for key: container.labels.com\_amazonaws\_ecs\_container-name, Error: key not found"

Looking at ECS container metadata produced by ecs-agent, the ContainerName property is present and has a value.

Any idea what could be the problem or how to debug further?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 3, 2023, 11:33am UTC](https://discuss.elastic.co/t/add-docker-metadata-is-not-able-to-pick-container-labels-com-amazonaws-ecs-container-name-for-a-short-living-containers/335196/2 "2023-07-03T11:33:36Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
