a1.channels = c1 c2a1.source.r1.selector.type = replicatinga1.sources.r1.type = spooldir
a1.sources.r1.spoolDir = /var/log/flume_spoolDir
a1.sources.r1.deletePolicy=immediate
a1.sources.r1.basenameHeader=true
#忽略copy时的.tmp文件,避免同时读写的问题
#a1.sources.r1.ignorePattern = ^(.)*\\.tmp$
a1.sources.r1.interceptors=i1
a1.sources.r1.interceptors.i1.type=org.apache.flume.interceptor.RegexExtractorExtInterceptor$Builder
a1.sources.r1.interceptors.i1.regex=(.*)_(.*)\\.(.*)
a1.sources.r1.interceptors.i1.extractorHeader=true
a1.sources.r1.interceptors.i1.extractorHeaderKey=basename
a1.sources.r1.interceptors.i1.serializers=s1 s2 s3
#basename's value must be filename_date.suffix. example storelog_2015-03-16.log
a1.sources.r1.interceptors.i1.serializers.s1.name=filename
a1.sources.r1.interceptors.i1.serializers.s2.name=date
a1.sources.r1.interceptors.i1.serializers.s3.name=suffix
a1.sources.r1.channels = c1 c2
# Describe the sink
a1.sinks.k1.type =hdfs
a1.sinks.k1.hdfs.path=hdfs://store.qbao.com:9000/storelog/bak/%{date}/%{filename}
a1.sinks.k1.hdfs.filePrefix=%{filename}_%{date}
a1.sinks.k1.hdfs.round = true
a1.sinks.k1.hdfs.rollInterval = 60
# File size to trigger roll, in bytes (0: never roll based on file size)
a1.sinks.k1.hdfs.rollSize = 128000000
a1.sinks.k1.hdfs.rollCount = 0
a1.sinks.k1.hdfs.batchSize = 100
a1.sinks.k1.hdfs.idleTimeout=60
a1.sinks.k1.hdfs.roundValue = 1
a1.sinks.k1.hdfs.roundUnit = minute
a1.sinks.k1.hdfs.useLocalTimeStamp = true
a1.sinks.k1.hdfs.fileType = DataStream
# Use a channel which buffers events in memory
#a1.channels.c1.type = memory
#a1.channels.c1.capacity = 1000
#a1.channels.c1.transactionCapacity = 200
a1.channels.c1.type = file
a1.channels.c1.checkpointDir=/opt/flume/checkpoint_c1
a1.channels.c1.dataDirs=/opt/flume/dataDir_c1
# Bind the source and sink to the channel
a1.sinks.k1.channel = c1
# Describe the sink
a1.sinks.k2.type =hdfs
a1.sinks.k2.hdfs.path=hdfs://store.qbao.com:9000/storelog/etl/%{filename}
a1.sinks.k2.hdfs.filePrefix=%{filename}_%{date}
a1.sinks.k2.hdfs.round = true
a1.sinks.k2.hdfs.rollInterval = 60
# File size to trigger roll, in bytes (0: never roll based on file size)
a1.sinks.k2.hdfs.rollSize = 128000000
a1.sinks.k2.hdfs.rollCount = 0
a1.sinks.k2.hdfs.batchSize = 100
a1.sinks.k2.hdfs.idleTimeout=60
a1.sinks.k2.hdfs.roundValue = 1
a1.sinks.k2.hdfs.roundUnit = minute
a1.sinks.k2.hdfs.useLocalTimeStamp = true
a1.sinks.k2.hdfs.fileType = DataStream
# Use a channel which buffers events in memory
#a1.channels.c2.type = memory
#a1.channels.c2.capacity = 1000
#a1.channels.c2.transactionCapacity = 200
a1.channels.c2.type = file
a1.channels.c2.checkpointDir=/opt/flume/checkpoint_c2
a1.channels.c2.dataDirs=/opt/flume/dataDir_c2
a1.sinks.k2.channel=c2