Merge pull request '增加排除文件的配置项' (#35) from pengln/filebeat:master into master

Reviewed-on: https://app.huanyuantech.com:10301/gitea/ansible-collection/filebeat/pulls/35
This commit is contained in:
pengln 2021-12-07 17:31:38 +08:00
commit 3aa63c5768
2 changed files with 4 additions and 0 deletions

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