# Docker Autodiscover AWS ECS

**URL:** <https://discuss.elastic.co/t/docker-autodiscover-aws-ecs/232179>\
**Category:** Beats\
**Tags:** docker, filebeat\
**Created:** [May 12, 2020, 9:35am UTC](https://discuss.elastic.co/t/docker-autodiscover-aws-ecs/232179 "2020-05-12T09:35:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gavin\_Hardy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gavin_hardy/32/46713_2.png) [@Gavin\_Hardy](https://discuss.elastic.co/u/Gavin_Hardy)\
**Post date:** [May 12, 2020, 9:35am UTC](https://discuss.elastic.co/t/docker-autodiscover-aws-ecs/232179/1 "2020-05-12T09:35:06Z")

</div>

Hello,

I am trying to setup autodiscover in docker, to only push locks from containers with a specified label. However, it appears to still be pushing all container logs. here is my filebeat.yml

```auto
  providers:
    - type: docker
      hints.enabled: false
      templates:
        - condition.contains:
            docker.container.labels.service: "test"
          config:
            - type: container
              paths:
                - "/var/lib/docker/containers/${data.docker.container.id}/*.log"
output.redis:
  hosts: "${REDIS_HOST}"
  key : "${REDIS_KEY}"

```

This is my docker-compose for filebeat

```auto
version: "3"
services:
  filebeat:
    image: ${REGISTRY}:filebeat-${ELK_VERSION}
    user: root
    volumes:
      - filebeat:/usr/share/filebeat/data
      - /var/run/docker.sock:/var/run/docker.sock
      - /var/lib/docker/containers/:/var/lib/docker/containers/:ro
    environment:
      - REDIS_HOST
      - REDIS_KEY
      - ELK_VERSION
    # disable strict permission checks
    command: ["--strict.perms=false"]
volumes:
  filebeat:

```

This is the docker-compose for the container I wish to push logs to ES from

```auto
version: '2'

services:
  test:
    image: ${REGISTRY}:${BUILD_NUMBER}
    environment:
      - NODE_ENV
      - REDIS_READ_HOST
      - REDIS_WRITE_HOST
    ports:
      - "1337"
    mem_limit: 2048m
    cpu_shares: 1024
    labels:
      service: "test"

```

Please help

Thank you

---

<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:** [June 9, 2020, 9:35am UTC](https://discuss.elastic.co/t/docker-autodiscover-aws-ecs/232179/2 "2020-06-09T09:35:17Z")

</div>

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