【发布时间】:2018-10-30 07:21:11
【问题描述】:
我已经设置了 fluentd 记录器,并且可以使用 fluentd tail input 插件来监控文件。 fluentd 接收到的所有数据随后发布到elasticsearch 集群。下面是fluentd的配置文件:
<source>
@type tail
path /home/user/Documents/log_data.json
format json
tag myfile
</source>
<match *myfile*>
@type elasticsearch
hosts 192.168.48.118:9200
user <username>
password <password>
index_name fluentd
type_name fluentd
</match>
如您所见,我正在使用tail 监控log_data.json 文件。我在同一目录中也有一个文件log_user.json,我也想监视它并将其日志发布到elasticsearch。为此,我想创建另一个带有不同标签的<source> 和<match>,但它开始显示错误。
如何监控fluentd 中的多个文件并将它们发布到elasticsearch。我看到当我们启动fluentd 时,它的工作人员已启动。是否可以启动多个工作人员,以便每个工作人员都监视不同的文件,或者以任何其他方式进行。谁能给我一些好的链接/教程。
谢谢。
【问题讨论】:
标签: json elasticsearch logging fluentd