一、描述
- 位于:根目录下的
filebeat.yml
文件type -> paths
二、配置
1、文件名不变
文件名不变,直接指定到对应文件即可
E:\test\log\test.log
2、文件名改变
[ 比如 ]
- 25号生成文件:
25.log
,25_api.log
- 26号生成文件:
26.log
,26_api.log
匹配 25.log,26.log
E:\test\log\[0-9][0-9].log
匹配 25_api.log,26_api.log
E:\test\log\[0-9][0-9]_api.log
3、其他
*
表示匹配任意文件- 如果要匹配多种文件名不同的日志文件,则需要
配置多个 - type: log
三、文件配置
1、配置多个日志来源
#=========================== Filebeat inputs =============================
filebeat.inputs:
- type: log
enabled: true
paths:
- /usr/local/gwt/nginx/logs/*access.log
tags: ["access"]
json.keys_under_root: true
json.add_error_key: true
- type: log
enabled: true
paths:
- /usr/local/gwt/nginx/logs/*error.log
tags: ["error"]