filebeat.yml 示例
filebeat.yml 示例
filebeat.inputs:
- type: filenames
paths:
- /var/log/app/*.log
fields:
service: api
fields_under_root: true
output.elasticsearch:
hosts: ["http://es:9200"]
index: "filebeat-%{+yyyy.MM.dd}"校验与运行
校验与运行
filebeat test config -c /etc/filebeat/filebeat.yml
filebeat test output
filebeat -e -c /etc/filebeat/filebeat.yml # 前台带日志运行fields 默认挂在 fields.* 下,fields_under_root: true 后置于顶层,便于后续按字段过滤。