# Filebeat add\_docker\_metadata incompatible

**URL:** <https://discuss.elastic.co/t/filebeat-add-docker-metadata-incompatible/284375>\
**Category:** Beats\
**Tags:** docker, filebeat\
**Created:** [September 16, 2021, 9:07am UTC](https://discuss.elastic.co/t/filebeat-add-docker-metadata-incompatible/284375 "2021-09-16T09:07:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bndlr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bndlr/32/94658_2.png) [@Bndlr](https://discuss.elastic.co/u/Bndlr)\
**Post date:** [September 16, 2021, 9:07am UTC](https://discuss.elastic.co/t/filebeat-add-docker-metadata-incompatible/284375/1 "2021-09-16T09:07:46Z")

</div>

Hey,  
i had an Issue with different docker-compose Versions and parse the Metadata.  
(Infrastructure is: Filebeat -\> Logstash -\> Elasticsearch)

First the Error Message from logstash:  
`failed to parse field [docker.container.labels.com.docker.compose.project] of type [text]`

docker-inspect from one machine:

```auto
"Labels": {
 "com.docker.compose.config-hash": "c19ea02a165f8a57ab71375089cbe695f1954aa33391f691391eeb8d1eee644b",
 "com.docker.compose.container-number": "1",
 "com.docker.compose.oneoff": "False",
 "com.docker.compose.project": "import_execution",
 "com.docker.compose.service": "proxy",
 "com.docker.compose.version": "1.24.0",
 "maintainer": "company"
 }

```

from another docker-compose version:

```auto
"Labels": {
 "com.docker.compose.config-hash": "7c6d5f1b83896e155f2605a38e09ab6d2cb4025f5603da0f40aa56fcb46964e4",
 "com.docker.compose.container-number": "1",
 "com.docker.compose.oneoff": "False",
 "com.docker.compose.project": "integration-environment",
 "com.docker.compose.project.config_files": "docker-compose.yml",
 "com.docker.compose.project.working_dir": "XYZ",
 "com.docker.compose.service": "proxy",
 "com.docker.compose.version": "1.26.2",
 "maintainer": "company"
 }

```

the first Index which was created with this log adds **com.docker.compose.project** as String, the second Environment try to insert the values from com.docker.compose.project as an "object".

Is there a way to handle this Problem? Because this can happen to future updates from docker-compose / docker as well and we don't want to reindex/refresh all Log Indicies.

i tried to manage this via json.keys\_under\_root true but fields are always structured as an Object in Kibana.

filebeat.yml

```auto
filebeat.inputs:
- type: docker
  enabled: true
  containers.ids: '*'
  json.keys_under_root: true
  json.add_error_key: true
  multiline.pattern: ^[0-9]{4}
  multiline.negate: true
  multiline.match: after

processors:
  - add_docker_metadata: ~

```

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [September 17, 2021, 12:35am UTC](https://discuss.elastic.co/t/filebeat-add-docker-metadata-incompatible/284375/2 "2021-09-17T00:35:44Z")

</div>

The `labels.dedot: true` option can prevent this sort of conflict between labels.

See [Add Docker metadata | Filebeat Reference [7.14] | Elastic](https://www.elastic.co/guide/en/beats/filebeat/current/add-docker-metadata.html).

---

<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:** [October 15, 2021, 2:36am UTC](https://discuss.elastic.co/t/filebeat-add-docker-metadata-incompatible/284375/3 "2021-10-15T02:36:33Z")

</div>

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