悟空,拿我的打狗棒来

filebeat reload功能不起作用

Beats | 作者 code4j | 发布于2018年09月06日 | 阅读数:6135

以前用flume做过日志采集,flume是有reload的功能的。filebeat的配置项中似乎也有reload的配置,但是它是reload的filebeat.yml 中引用的其他配置文件,按照官方我是这么配置的。
filebeat.yml:
filebeat.config.inputs:

enabled: true
path: input.yml
reload.enabled: true
reload.period: 10s

然后在外面定义一个 input.yml,配置如下:
filebeat.inputs:
- type: log

# Change to true to enable this input configuration.
enabled: true

# Paths that should be crawled and fetched. Glob based paths.
paths:
- /opt/log/trace.log
#- c:\programdata\elasticsearch\logs\*


fields:
cluster: trace

multiline.pattern: '^\['

multiline.negate: true

multiline.match: after

 
启动filebeat后发现似乎并没有将日志采集到,而且reload也并没有生效
 
 
一开始input.yml文件权限不对,还会有提示,后来修改完权限重启后提示也没有了,而且采集也没有生效,求教
 
 
 
找到问题了,第一行不能加filebeat.inputs:,必须以- type开头,官方的说明:
 
 
The first line of each external configuration file must be an input definition that starts with 
- type
. Make sure you omit the line 
filebeat.config.inputs
 from this file.
已邀请:

rockybean - Elastic Certified Engineer, ElasticStack Fans,公众号:ElasticTalk

赞同来自: vickluky

input.yml 错了,要以 -type:log  开始,见文档
https://www.elastic.co/guide/e ... .html

要回复问题请先登录注册