ELK中安装filebeat时遇到的问题

本文讲述了在ELK安装过程中,使用Filebeat时遇到的启动失败问题,关键在于设置index时需配合ILM设置。解决方法包括配置setup.template.name和pattern,并确保在ILM禁用时生效。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Filebeat启动失败的问题

ELK安装过程遇到的问题

在安装ELK的过程中用到了Filebeat,按照官网教程一路下来,(只是在写入es时,自定义了index)在最后启动服务的时候,启动失败。

通过查看日志找到了原因:

 journalctl -u filebeat.service

详解失败原因如下:
在这里插入图片描述
从日志中我们可以看出:在设置了index的时候,我们就必须要设置以下两项

 setup.template.name: "demo"
109 setup.template.pattern: "demo-*"

设置完这两项后,服务可以起来,但发现index并未按照自定义的格式,仍然使用的是系统默认的格式!
系统默认格式为:

filebeat-%{[agent.version]}-*

于是又开始了无休止的查找官网文档,最终找到了原因,请看如下官网原文:

The index name to write events to when you’re using daily indices. The
default is “filebeat-%{[agent.version]}-%{+yyyy.MM.dd}”, for example,
“filebeat-7.12.0-2021-04-21”. If you change this setting, you also
need to configure the setup.template.name and setup.template.pattern
options (see Elasticsearch index template).

If you are using the pre-built Kibana dashboards, you also need to set
the setup.dashboards.index option (see Kibana dashboards).

When index lifecycle management (ILM) is enabled, the default index is
“filebeat-%{[agent.version]}-%{+yyyy.MM.dd}-%{index_num}”, for
example, “filebeat-7.12.0-2021-04-21-000001”. Custom index settings
are ignored when ILM is enabled.
If you’re sending events to a cluster
that supports index lifecycle management, see Index lifecycle
management (ILM) to learn how to change the index name.

官网说的很明确了,当ILM启用时,自定义的index不生效,我们要想用自定义的index,还需要关闭ILM功能。

setup.ilm.enabled:false

至此,问题解决。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值