Repository: kzk/docker-compose-efk Branch: master Commit: 176716f9736e Files: 4 Total size: 6.6 KB Directory structure: gitextract_9sblb7yx/ ├── README.md ├── docker-compose.yml └── fluent-bit/ └── conf/ ├── fluent-bit.conf └── parsers.conf ================================================ FILE CONTENTS ================================================ ================================================ FILE: README.md ================================================ Docker compose file for setting up a EFK service ================================================ A basic docker compose file that will set up Elasticsearch, Fluent Bit, and Kibana. The following docker compose allows to ingest data through Forward protocol or Syslog in UDP mode, examples: ### Send data through Forward protocol ```json echo "{\"key\": 1234}" | fluent-cat test ``` ### Send data through Syslog UDP socket ```bash logger -d -n 127.0.0.1 --port 5140 "hello" ``` ================================================ FILE: docker-compose.yml ================================================ version: '2.2' services: fluent-bit: image: fluent/fluent-bit:1.5 volumes: - ./fluent-bit/conf:/fluent-bit/etc links: - "elasticsearch" ports: - 24224:24224 - 5140:5140/udp - 2020:2020 logging: driver: "json-file" options: max-size: 100m max-file: "5" networks: - elastic elasticsearch: image: docker.elastic.co/elasticsearch/elasticsearch:7.8.1 container_name: es01 ports: - "9200:9200" networks: - elastic environment: - node.name=es01 - cluster.name=es-docker-cluster - bootstrap.memory_lock=false - cluster.initial_master_nodes=es01 - "ES_JAVA_OPTS=-Xms512m -Xmx512m" kibana: image: docker.elastic.co/kibana/kibana:7.8.1 container_name: kib01 links: - "elasticsearch" ports: - 5601:5601 environment: ELASTICSEARCH_URL: http://es01:9200 ELASTICSEARCH_HOSTS: http://es01:9200 networks: - elastic networks: elastic: driver: bridge ================================================ FILE: fluent-bit/conf/fluent-bit.conf ================================================ [SERVICE] flush 1 log_Level info daemon off parsers_File parsers.conf http_server on http_listen 0.0.0.0 http_port 2020 storage.metrics on [INPUT] name forward max_chunk_size 1M max_buffer_size 5M [INPUT] name syslog mode udp [OUTPUT] name es match * host es01 port 9200 logstash_format on replace_dots on retry_limit false ================================================ FILE: fluent-bit/conf/parsers.conf ================================================ [PARSER] Name apache Format regex Regex ^(?[^ ]*) [^ ]* (?[^ ]*) \[(?