使用taildir实现同时收集文件夹和文件的功能
Flume在1.7之前没有提供tail dir source这样的命令,需要自己编译tail dir source的jar包,编译好之后上传到flume的lib目录下,
jar包下载地址
链接:https://pan.baidu.com/s/1oIPqyvALUyzpd8YpdpNEqA
配置文件参考:
taildir.properties
# in this case called 'a1'
a1.sources = s1
a1.channels = c1
a1.sinks = k1
# For each one of the sources, the type is defined
a1.sources.s1.type = org.apache.flume.source.taildir.TaildirSource
a1.sources.s1.positionFile = /opt/cdhmoduels/apache-flume-1.5.0-cdh5.3.6-bin/taidir/dirsource/taildir_position.json
a1.sources.s1.filegroups = f1 f2
a1.sources.s1.filegroups.f1 = /opt/cdhmoduels/apache-flume-1.5.0-cdh5.3.6-bin/taidir/madman.txt