我用 filebeat 推送日志到 es,然后自己写了一个 module,可以正常解析日志。我在 filebeat.yml 里配置了两个 index
template 做匹配
这样启动以后,日志可以正常推送,也能看到两个 index,但是 ro 的日志字段跟我写类型不符,全是 string。另外日志会报错
output.elasticsearch:
# Array of hosts to connect to.
hosts: ["localhost:9200"]
index: "nginx-%{[beat.version]}-%{+yyyy.MM.dd}"
indices:
- index: "ro-%{[beat.version]}-%{+yyyy.MM.dd}"
when.contains:
source: "ro"
然后,我把对应的解析放到了 fields.yml 里面,并在filebeat.yml 配置了两个,我不知道 index 怎么跟template 做匹配
setup.template.name: "nginx"
#setup.template.fields: "${path.config}/fields.yml"
setup.template.overwrite: false
setup.template.pattern: "nginx-*"
setup.template.name: "ro"
setup.template.pattern: "ro*"
这样启动以后,日志可以正常推送,也能看到两个 index,但是 ro 的日志字段跟我写类型不符,全是 string。另外日志会报错
2018-01-17T17:02:34+08:00 INFO Connected to Elasticsearch version 6.1.1
2018-01-17T17:02:34+08:00 INFO Template already exists and will not be overwritten.
2018-01-17T17:02:35+08:00 ERR Failed to publish events: temporary bulk send failure
求各位看看是什么问题
1 个回复
rockybean - Elastic Certified Engineer, ElasticStack Fans,公众号:ElasticTalk
赞同来自: