From 8a9799148cf79e5957a27baad8479ccdbb3444ee Mon Sep 17 00:00:00 2001 From: pengln Date: Tue, 7 Dec 2021 17:31:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8E=92=E9=99=A4=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E7=9A=84=E9=85=8D=E7=BD=AE=E9=A1=B9=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E9=BB=98=E8=AE=A4=E6=8E=92=E9=99=A4gateway=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E7=9A=84*=5F81.log=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- playbooks/roles/filebeat/defaults/main.yml | 1 + playbooks/roles/filebeat/templates/filebeat.yml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/playbooks/roles/filebeat/defaults/main.yml b/playbooks/roles/filebeat/defaults/main.yml index 9a6cf1e..3a9ce8d 100644 --- a/playbooks/roles/filebeat/defaults/main.yml +++ b/playbooks/roles/filebeat/defaults/main.yml @@ -22,6 +22,7 @@ filebeat_logs: index_prefix: "gw-nginx" template_name: "gw-nginx-ug10cn" template_pattern: "gw-nginx-*" + exclude_files: '_81\.log$' dissect_tokenizers: - tokenizer: "/%{}/%{}/%{}/%{}_%{sublog}.log" field_name: "log.file.path" diff --git a/playbooks/roles/filebeat/templates/filebeat.yml b/playbooks/roles/filebeat/templates/filebeat.yml index 7c5f4c5..d60addd 100644 --- a/playbooks/roles/filebeat/templates/filebeat.yml +++ b/playbooks/roles/filebeat/templates/filebeat.yml @@ -9,6 +9,9 @@ filebeat.config.inputs: filebeat.inputs: - type: log paths: {{ logs[log_type]['paths'] }} + {% if logs[log_type]['exclude_files'] -%} + exclude_files: {{ logs[log_type]['exclude_files'] }} + {% endif -%} harvester_buffer_size: 40960 ignore_older: {{ filebeat_older }} tail_files: {{ filebeat_tail_files | string | lower }} -- 2.40.1