Created
July 13, 2021 13:47
-
-
Save syrm/fcbd81f375c9cd9704ca051d51a9d553 to your computer and use it in GitHub Desktop.
This file contains 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
Il faut customiser dans docker-compose.yml : | |
- ./data/elasticsearch:/usr/share/elasticsearch/data | |
vous remplacez "data/elasticsearch" par le dossier ou vous voulez que Elasticsearch sauvegarde ses données. | |
- ./data/log/:/data/log:ro | |
vous remplacez "data/log" par le dossier ou sont stockés vous logs | |
Ensuite dans Kibana (accessible sur http://localhost:5601/) il faut aller dans "Management > Index Patterns" et créer un index avec le nom "filebeat-* | |
Note : pour pouvoir créer cet index pattern vous devez déjà avoir généré des logs applicatifs pour que Filebeat ai commencé à écrire des données dans Elasticsearch |
This file contains 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.9' | |
services: | |
elasticsearch: | |
image: "docker.elastic.co/elasticsearch/elasticsearch:7.13.0" | |
environment: | |
- "ES_JAVA_OPTS=-Xms1g -Xmx1g" | |
- "discovery.type=single-node" | |
ports: | |
- "9200:9200" | |
volumes: | |
- ./data/elasticsearch:/usr/share/elasticsearch/data | |
kibana: | |
image: "docker.elastic.co/kibana/kibana:7.2.0" | |
ports: | |
- "5601:5601" | |
filebeat: | |
image: "docker.elastic.co/beats/filebeat:7.2.0" | |
command: filebeat -e -strict.perms=false | |
user: root | |
volumes: | |
- ./filebeat.yml:/usr/share/filebeat/filebeat.yml:ro | |
- ./data/log/:/data/log:ro |
This file contains 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.inputs: | |
- type: log | |
paths: | |
- '/data/log/*.log' | |
processors: | |
- decode_json_fields: | |
fields: ["message"] | |
target: "json" | |
overwrite_keys: true | |
output.elasticsearch: | |
hosts: ["elasticsearch:9200"] | |
indices: | |
- index: "filebeat-%{[agent.version]}-%{+yyyy.MM.dd}" | |
logging.json: true | |
logging.metrics.enabled: false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment