From 5ca792e161c95209d47407ac2cd79876d1b2e1f0 Mon Sep 17 00:00:00 2001 From: Olivier Cervello Date: Thu, 30 Sep 2021 17:32:04 +0200 Subject: [PATCH] Update filebeat config --- conf/filebeat.yml | 38 +++++++++++++++----- docker-compose.yml | 3 -- docs/how-to-guides/docker-developer-guide.md | 4 +-- 3 files changed, 32 insertions(+), 13 deletions(-) diff --git a/conf/filebeat.yml b/conf/filebeat.yml index fc21fe27e3287..c7f10d6677fe9 100644 --- a/conf/filebeat.yml +++ b/conf/filebeat.yml @@ -1,17 +1,39 @@ -filebeat.config: - modules: - path: ${path.config}/modules.d/*.yml - reload.enabled: false - filebeat.autodiscover: providers: - type: docker hints.enabled: true + templates: + - conditions: + contains: + docker.container.image: nginx + config: + - module: nginx + access: + enabled: true + input: + type: docker + containers: + ids: "${data.docker.container.id}" + stream: "stdout" + error: + enabled: true + input: + type: docker + containers: + ids: "${data.docker.container.id}" + stream: "stderr" + +processors: +- add_docker_metadata: ~ +- add_locale: + format: offset +- add_host_metadata: + netinfo.enabled: trues + +# output.console: +# pretty: true output.elasticsearch: hosts: ["${ELASTICSEARCH_HOSTS}"] indices: - index: "logs-%{+yyyy.MM.dd}" - -logging.json: true -logging.metrics.enabled: false diff --git a/docker-compose.yml b/docker-compose.yml index a7b7f11177c59..72a4541a7f876 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -99,9 +99,6 @@ services: - js_dist:/opt/product-opener/html/js/dist - css_dist:/opt/product-opener/html/css/dist - # Logs - - ./logs/nginx/:/var/log/nginx/ - # Nginx, we use templates dir to be able to use environment vars - ./conf/nginx.conf:/etc/nginx/templates/default.conf.template diff --git a/docs/how-to-guides/docker-developer-guide.md b/docs/how-to-guides/docker-developer-guide.md index 47be08608562b..c39843e006099 100644 --- a/docs/how-to-guides/docker-developer-guide.md +++ b/docs/how-to-guides/docker-developer-guide.md @@ -14,6 +14,8 @@ make log ### Tail other logs +Other logs are automatically mounted from the containers to your `logs/` directory. + ``` make tail ``` @@ -23,8 +25,6 @@ It will `tail -f` all the files present in the `logs/` directory: * `apache2/log4perl.log` * `apache2/modperl_error.log` * `apache2/other_vhosts_access.log` -* `nginx/access.log` -* `nginx/error.log` You can also simply run: ```