Docker Autodiscover AWS ECS

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

  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

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

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

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