其他分享
首页 > 其他分享> > flume监听日志文件

flume监听日志文件

作者:互联网

控制台监听打印flume-exec.log文件写入数据

# Define a memory channel called ch1 on agent1
agent1.channels.ch1.type = memory
agent1.channels.ch1.capacity = 1000
agent1.channels.ch1.transactionCapacity = 100
 
# Define an Avro source called avro-source1 on agent1 and tell it
# to bind to 0.0.0.0:41414. Connect it to channel ch1.
agent1.sources.avro-source1.channels = ch1
agent1.sources.avro-source1.type = exec
agent1.sources.avro-source1.command = tail -F /soft/data/flume-exec.log

 
# Define a logger sink that simply logs all events it receives
# and connect it to the other end of the same channel.
agent1.sinks.log-sink1.channel = ch1
agent1.sinks.log-sink1.type = logger
 
# Finally, now that we've defined all of our components, tell
# agent1 which ones we want to activate.
agent1.channels = ch1
agent1.sources = avro-source1
agent1.sinks = log-sink1

flume-ng agent --conf $FLUME_HOME/conf -f $FLUME_HOME/conf/exec2.conf -Dflume.root.logger=DEBUG,console -n agent1

在这里插入图片描述
在这里插入图片描述
flume可指定接收的event直接写到hdfs做离线分析,后面项目接入打算先写到kafka,再做实时流处理

标签:flume,log,avro,channels,ch1,agent1,日志,监听
来源: https://blog.csdn.net/u011731233/article/details/115037376