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 }}