0
点赞
收藏
分享

微信扫一扫

ELK~fluentd将日志文件增量读到es里

之前的文章说过通过sidecar实现fluentd插件在容器上的挂载,直接将容器某个目录的log文件收集到es里,今天主要说一下关于fluentd.config的配置,就是在k8s里的configmap文件。

<source>
type tail
format json
path /home/apps/logs/*.log #日志文件
pos_file /home/apps/logs/*.log.pos #偏移
tag lind #标签,对于 match.logstash_prefix,最后在kinaba的索引配置里体现
</source>
<match lind>
@id elasticsearch
@type elasticsearch
@log_level INFO
type_name _doc #只接受_doc
host elasticsearch.elk
port 9200
include_tag_key true
tag_key @log_name
logstash_format true
logstash_prefix fluentd-${tag}
flush_interval 10s
</match>

作者:仓储大叔,张占岭,
荣誉:微软MVP

举报

相关推荐

0 条评论