flume 示例一收集tomcat日志
例子场景描述:将tomcat的日志收集到指定的目录,tomcat 安装在/opt/tomcat, 日志存放在var/log/data。 配置tomcat.conf 如下: # A single-node Flume configuration # Name the components on this agent 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