增加排除文件的配置项 #35

Merged
pengln merged 1 commits from pengln/filebeat:master into master 2021-12-07 17:31:39 +08:00
2 changed files with 4 additions and 0 deletions
Showing only changes of commit 8a9799148c - Show all commits

View File

@ -22,6 +22,7 @@ filebeat_logs:
index_prefix: "gw-nginx" index_prefix: "gw-nginx"
template_name: "gw-nginx-ug10cn" template_name: "gw-nginx-ug10cn"
template_pattern: "gw-nginx-*" template_pattern: "gw-nginx-*"
exclude_files: '_81\.log$'
dissect_tokenizers: dissect_tokenizers:
- tokenizer: "/%{}/%{}/%{}/%{}_%{sublog}.log" - tokenizer: "/%{}/%{}/%{}/%{}_%{sublog}.log"
field_name: "log.file.path" field_name: "log.file.path"

View File

@ -9,6 +9,9 @@ filebeat.config.inputs:
filebeat.inputs: filebeat.inputs:
- type: log - type: log
paths: {{ logs[log_type]['paths'] }} paths: {{ logs[log_type]['paths'] }}
{% if logs[log_type]['exclude_files'] -%}
exclude_files: {{ logs[log_type]['exclude_files'] }}
{% endif -%}
harvester_buffer_size: 40960 harvester_buffer_size: 40960
ignore_older: {{ filebeat_older }} ignore_older: {{ filebeat_older }}
tail_files: {{ filebeat_tail_files | string | lower }} tail_files: {{ filebeat_tail_files | string | lower }}