I am using env variables in filebeat.yml, it is failing to parse the variables.

filebeat.yml
------------

```
 output.elasticsearch:
 hosts: [$ELASTICSEARCH_HOST]
 template:
  name: "filebeat"
  path: "fields.yml"
 overwrite: false
 protocol: "http"

```

docker-compose.yml
------------------

```
  version: "3.5"

  services:

   filebeat:
       build:
       context: ./filebeat
       args:
        ELK_VERSION: $ELK_VERSION
       volumes:
           - "/var/lib/docker/containers:/usr/share/dockerlogs/data:ro"
           - "/var/run/docker.sock:/var/run/docker.sock"

   networks:
    default:
     name: filebeat-nw
     external: true

```

I exported the variable $ELASTICSEARCH\_HOST to the environment variables. However it is failing to parse the document.

I am running the container as a service with the command "docker-compose up --build"

I want to understand how to use environment variables in filebeat.yml file.

Thank You.