在flume1.6版本及之前,如果想要监控多个目录下的多个文件,可以使用Filelistener,在flume1.7之后,增加了TAILDIR,主要是监控文件的变化
参考配置:
a1.sources
=r1
a1.sinks
=s1
a1.channels
=c1
a1.sources.r1.type
=TAILDIR
a1.sources.r1.positionFile
= /opt/module/flume/data/taildir_position.json
a1.sources.r1.filegroups
= f1 f2
a1.sources.r1.filegroups.f1
= /opt/module/flume/data/test1/.*log
a1.sources.r1.filegroups.f2
= /opt/module/flume/data/test2/.*txt
a1.sinks.s1.type
=file_roll
a1.sinks.s1.sink.directory
=/home/work/rolldata
a1.sinks.s1.sink.rollInterval
=0
a1.channels.c1.type
=memory
a1.channels.c1.capacity
=1000
a1.channels.c1.transactionCapacity
=100
a1.sources.r1.channels
=c1
a1.sinks.s1.channel
=c1