Last active
February 23, 2019 22:59
-
-
Save cchacin/d94f9f5dfa051bbd4802f182cbb73544 to your computer and use it in GitHub Desktop.
ELK Stack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.7" | |
services: | |
filebeat: | |
image: docker.elastic.co/beats/filebeat-oss:6.6.1 | |
container_name: filebeat | |
hostname: filebeat | |
depends_on: | |
- elasticsearch | |
environment: | |
- setup.kibana.host=kibana:5601 | |
- output.elasticsearch.hosts=["elasticsearch:9200"] | |
volumes: | |
- "./filebeat/filebeat.yml:/usr/share/filebeat/filebeat.yml" | |
- "/var/lib/docker/containers:/usr/share/dockerlogs/data:ro" | |
- "/var/run/docker.sock:/var/run/docker.sock" | |
- /tmp/logs:/tmp/logs | |
user: root | |
elasticsearch: | |
image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.6.1 | |
container_name: elasticsearch | |
hostname: elasticsearch | |
ports: | |
- 9200:9200 | |
- 9300:9300 | |
elasticapm: | |
image: docker.elastic.co/apm/apm-server-oss:6.6.1 | |
container_name: elasticapm | |
hostname: elasticapm | |
# environment: | |
# - setup.kibana.host=http://localhost:5601 | |
depends_on: | |
- elasticsearch | |
ports: | |
- 8200:8200 | |
kibana: | |
image: docker.elastic.co/kibana/kibana-oss:6.6.1 | |
container_name: kibana | |
hostname: kibana | |
depends_on: | |
- elasticsearch | |
ports: | |
- 5601:5601 | |
coffee-shop: | |
build: | |
context: . | |
container_name: coffee-shop | |
hostname: coffee-shop | |
depends_on: | |
- filebeat | |
ports: | |
- 9080:9080 | |
- 9443:9443 | |
volumes: | |
- /tmp/logs:/tmp/logs | |
volumes: | |
# create a persistent volume for Filebeat | |
filebeat_data: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filebeat.prospectors: | |
- type: log | |
json.keys_under_root: true | |
json.message_key: message | |
enabled: true | |
paths: | |
- /tmp/logs/messages.log | |
logging.to_files: true | |
logging.to_syslog: false | |
filebeat.config.modules: | |
path: ${path.config}/modules.d/*.yml | |
reload.enabled: true | |
reload.period: 120s | |
setup.template.settings: | |
index.number_of_shards: 3 | |
#index.codec: best_compression | |
#_source.enabled: false | |
tags: ["coffee-shop", "api"] | |
fields: | |
env: staging | |
setup.kibana: | |
host: "kibana:5601" | |
output.elasticsearch: | |
hosts: ["elasticsearch:9200"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment