Error when trying to run filebeat using docker-compose

38 Views Asked by At

I'm trying to run Elasticsearch, Kibana and Filebeat through docker-compose on Ubuntu. Elasticsearch and Kibana are starting normally, but Filebeat is giving an error in the filebeat.yml file.

I've already tried using different versions of Filebeat, but the problem remains the same.

Does anyone know how to solve it?

terminal error

docker-compose.yml

version: '3.8'

services:   
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.16.2
    ports:
      - "9200:9200"
      - "9300:9300"
    environment:
      discovery.type: "single-node"
      ES_JAVA_OPTS: "-Xms2g -Xmx2g"
      xpack.monitoring.enabled: "true"
    volumes:
      - ./esdata:/usr/share/elasticsearch/data
      
  filebeat:
    image: docker.elastic.co/beats/filebeat:7.16.2
    build: filebeat
    entrypoint: "filebeat -e -strict.perms=false"
    container_name: filebeat
    restart: unless-stopped
    volumes:
      - ./filebeat.yml:/usr/share/filebeat/filebeat.yml:ro
      - ./logs:/usr/share/filebeat/logs:ro
    logging:
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "2"
    depends_on:
      - elasticsearch
      
  kibana:
    image: docker.elastic.co/kibana/kibana:7.16.2
    restart: always
    ports:
      - "5601:5601"
    environment:
      ELASTICSEARCH_URL: http://elasticsearch:9200
    depends_on:
      - elasticsearch
      
volumes:
  esdata:
    driver: local
1

There are 1 best solutions below

0
Murat K. On

In this documentation of elasticsearch, volume is defined like this:

--volume="$(pwd)/filebeat.docker.yml:/usr/share/filebeat/filebeat.yml:ro" \

Maybe this can be the issue.