1.写配置文件
agent:exec source + memory channel + logger sink
a1.sources = r1
a1.sinks = k1
a1.channels = c1
a1.sources.r1.type = exec #exec source 可以运行一个给定的shell命令
a1.sources.r1.command = tail -F “预监听文件的路径”
a1.sources.r1.shell = /bin/sh -c
a1.sinks.k1.type = logger
a1.channels.c1.type = memory
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1
写入到example2.conf中
2.启动agent
flume-ng agent \
--name a1 \
--conf $FLUME_HOME/conf \
--conf-file $FLUME_HOME/conf/example2.conf \
-Dflume.root.logger=INFO,console