# Convert/Ingest Docker container Environment Variables into Filebeat/Logstash fields

**URL:** https://discuss.elastic.co/t/convert-ingest-docker-container-environment-variables-into-filebeat-logstash-fields/310340
**Category:** Beats
**Tags:** docker, filebeat
**Created:** [July 21, 2022, 9:17pm UTC](https://discuss.elastic.co/t/convert-ingest-docker-container-environment-variables-into-filebeat-logstash-fields/310340 "2022-07-21T21:17:04Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Julian\_Barnett](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/julian_barnett/32/108675_2.png) [@Julian\_Barnett](https://discuss.elastic.co/u/Julian_Barnett)
#### Post date: [July 21, 2022, 9:17pm UTC](https://discuss.elastic.co/t/convert-ingest-docker-container-environment-variables-into-filebeat-logstash-fields/310340/1 "2022-07-21T21:17:04Z")

</div>

I'm currently using filebeat 8.3.0 and we're copying a few container LABELS to fields via something like this:

```auto
- copy_fields:
      fields:
        - from: container.labels.custom_label
          to: custom_label

```

We have a few containers that populate environment variables with something like this:

```auto
 "Env": [
                "CONTAINER_RELEASE=100133",
                "LOGSTASH_FIELDS=env=dev,role=custom-role,service=myservice,build=123456,test_session_id=987654"
]

```

I can't seem to find a way in filebeat to ingest environment variables from the docker containers TO a custom field like we're doing with the labels. Is this possible, and if so how? Documentation doesn't seem to indicate it is so I'm leaning towards thinking we're going to need to modify our container config to send the Environment variable data to a label instead.

Would appreciate some guidance here.

Thanks,  
Julian

---

<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: [August 18, 2022, 11:17pm UTC](https://discuss.elastic.co/t/convert-ingest-docker-container-environment-variables-into-filebeat-logstash-fields/310340/2 "2022-08-18T23:17:40Z")

</div>

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