filebeat.config:
modules:
path: ${path.config}/modules.d/*.yml
reload.enabled: true
processors:
- add_cloud_metadata: ~
- add_docker_metadata: ~
output.elasticsearch:
hosts: '${ELASTICSEARCH_HOSTS:192.168.122.33:9200}'
username: '${ELASTICSEARCH_USERNAME:elastic}'
password: '${ELASTICSEARCH_PASSWORD:密码}'
index: "ngx100-%{+yyyy.MM.dd}"
setup.template.name: "ngx100"
setup.template.pattern: "ngx100-%{+yyyy.MM.dd}"
- module: nginx
access:
enabled: true
var.paths: ["/dataN/ngx8/logs-A100/access-*.log"]
error:
enabled: true
var.paths: ["/dataN/ngx8/logs-A100/error.log*"]
ingress_controller:
enabled: false
阿里云说明
https://developer.aliyun.com/article/887241
vim /etc/filebeat/filebeat.yml
filebeat.inputs:
- type: log
enabled: true
paths:
- /dataN/ngx8/logs-A100/access-*.log
# - /dataN/ngx8/logs-A100/error.log #错误日志不是json格式,解析出错误
json.keys_under_root: true
json.overwrite_keys: true