taildir.conf
a1.sources = r1
a1.sinks = k1
a1.channels = c1
a1.sources.r1.type = TAILDIR
a1.sources.r1.filegroups=f1 f2
a1.sources.r1.filegroups.f1=/root/data/tail_1/example.log
a1.sources.r1.filegroups.f2=/root/data/tail_2/.*log.*
a1.sources.r1.positionFile= /root/data/tail_position/taildir_position.json
a1.sources.r1.headers.f1.headerkey1 = value1
a1.sources.r1.headers.f2.headerkey1 = value2
a1.sources.r1.headers.f2.headerkey2 = value3
a1.sources.r1.fileHeader=true
a1.sinks.k1.type = logger
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1
往/root/data/tail_2/.log. 添加文件
运行监控
./bin/flume-ng agent --name a1 --conf conf/ --conf-file conf/job/taildir.conf -Dflume.root.logger=INFO,console
本文详细解析了Flume的taildir.conf配置文件,展示了如何通过Flume从指定目录下的日志文件中收集数据,并将数据传递到内存通道,最终使用logger接收器进行输出。配置包括了source、sink、channel的类型设定,以及文件组、位置文件、header设置等关键参数。
3385

被折叠的 条评论
为什么被折叠?



