例子场景描述:
将tomcat的日志收集到指定的目录,tomcat 安装在/opt/tomcat, 日志存放在var/log/data
技术选型 exec - file - file_roll
# A single-node Flume configuration # Name the components on thisagent agent1.sources = source1 agent1.sinks = sink1 agent1.channels = channel1 # Describe/configure source1 agent1.sources.source1.type = exec agent1.sources.source1.command = tail -n +0 -F /opt/tomcat/logs/catalina.out agent1.sources.source1.channels = channel1 # Describe sink1 agent1.sinks.sink1.type = file_roll agent1.sinks.sink1.sink.directory=/var/log/data # Use a channel which buffers events in memory agent1.channels.channel1.type = file agent1.channels.channel1.checkpointDir=/var/checkpoint agent1.channels.channel1.dataDirs=/var/tmp agent1.channels.channel1.capacity = 1000 agent1.channels.channel1.transactionCapactiy = 100 # Bind the source and sink to the channel agent1.sources.source1.channels = channel1 agent1.sinks.sink1.channel = channel1
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31441024/viewspace-2199627/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/31441024/viewspace-2199627/