ITPub博客

首页 > 大数据 > 数据分析 > Flume收集日志到本地目录

Flume收集日志到本地目录

原创 数据分析 作者:13545163656 时间:2018-08-10 11:26:22 0 删除 编辑


例子场景描述:

   将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博客 ” ,链接:https://blog.itpub.net/31441024/viewspace-2199627/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: Flume采集到HDFS
请登录后发表评论 登录
全部评论

注册时间:2017-03-05

  • 博文量
    70
  • 访问量
    97995