diff --git a/docker-compose-logging.yml b/docker-compose-logging.yml new file mode 100644 index 0000000..1269628 --- /dev/null +++ b/docker-compose-logging.yml @@ -0,0 +1,67 @@ +version: '3' + +services: + logspout: + image: bekt/logspout-logstash + restart: on-failure + environment: + RETRY_STARTUP: 'true' + RETRY_SEND: 'true' + LOGSTASH_TAGS: 'docker' + ROUTE_URIS: 'logstash://logstash:25826' + links: + - logstash + volumes: + - '/var/run/docker.sock:/tmp/docker.sock' + logging: + driver: 'json-file' + options: + max-file: '5' + max-size: 10m + + elasticsearch: + image: docker.elastic.co/elasticsearch/elasticsearch:6.3.2 + restart: on-failure + ports: + - "9200:9200" + volumes: + - elastic:/usr/share/elasticsearch/data + depends_on: + - logstash + logging: + driver: 'json-file' + options: + max-file: '5' + max-size: 10m + + kibana: + image: docker.elastic.co/kibana/kibana:6.3.2 + restart: on-failure + ports: + - "5601:5601" + depends_on: + - elasticsearch + logging: + driver: 'json-file' + options: + max-file: '5' + max-size: 10m + + logstash: + image: docker.elastic.co/logstash/logstash:6.3.2 + restart: on-failure + environment: + LOGSPOUT: ignore + ports: + - "25826:25826" + volumes: + - ./elk-config/logstash.config:/usr/share/logstash/pipeline/logstash.config + command: logstash -f /usr/share/logstash/pipeline/logstash.config + logging: + driver: 'json-file' + options: + max-file: '5' + max-size: 10m + +volumes: + elastic: \ No newline at end of file diff --git a/elk-config/logstash.config b/elk-config/logstash.config new file mode 100644 index 0000000..26736d3 --- /dev/null +++ b/elk-config/logstash.config @@ -0,0 +1,24 @@ +input { + heartbeat { + id => 'heartbeat' + interval => 60 + message => 'logstash' + } + + udp { + id => 'docker-logspout' + port => 25826 + codec => json + } + + syslog { + id => 'docker-syslog' + port => 5001 + } +} + +output { + elasticsearch { + hosts => [ 'elasticsearch' ] + } +} \ No newline at end of file