Well,不要刷屏了

filebeat配置多index,索引到底是index还是indices:-index?

Elasticsearch | 作者 hnbc | 发布于2018年10月09日 | 阅读数:8199

filebeat配置多index,配置文件里面配了index和indices:-index,启动filebeat之后,查看索引,只有index这个索引,通过这个索引查看的是监控的多个文件的所有数据;indeces里面的索引没有查到,也不能通过这个索引查看数据,如果去掉上面的index,查看生成的索引,是默认生成的filebeat-version-xxx,indices的索引依然没有生效,新手,望大神解答!!!
QQ截图20181009110116.png
已邀请:

rochy - rochy_he

赞同来自: hnbc

看起来像是配置文件的缩进问题,yml 对缩进要求很严格,请检查修改后,重启 filebeat 试一下
output.elasticsearch:
hosts: ["http://localhost:9200"]
index: "logs-%{[beat.version]}-%{+yyyy.MM.dd}"
indices:
- index: "critical-%{[beat.version]}-%{+yyyy.MM.dd}"
when.contains:
message: "CRITICAL"
- index: "error-%{[beat.version]}-%{+yyyy.MM.dd}"
when.contains:
message: "ERR"

rochy - rochy_he

赞同来自:

下面的两个是有条件支撑的,如果不满足条件是不会生成这些索引的
先看一下你的日志是否满足条件

hnbc

赞同来自:

这个是我的配置,创建多索引,日志没有报错,但是indices里面的索引依旧没有成功创建

要回复问题请先登录注册