agent05.sources = source1 
agent05.channels = sink01 sink02
agent05.sinks = elasticSearch

####source1######
agent05.sources.source1.type = exec
agent05.sources.source1.command = tail -F /var/prog/backend/logs/backend.log
agent05.sources.source1.restart = true
agent05.sources.source1.logStdErr = true
agent05.sources.source1.batchSize = 500
agent05.sources.source1.channels = sink02


agent05.sources.source1.interceptors = interceptor1 interceptor2 interceptor3
agent05.sources.source1.interceptors.interceptor1.type = host
agent05.sources.source1.interceptors.interceptor1.hostHeader = host

agent05.sources.source1.interceptors.interceptor2.type = regex_extractor
agent05.sources.source1.interceptors.interceptor2.regex = ^[^\\s]*\\s(\\d{0,4}-\\d{1,2}-\\d{1,2}\\s\\d{1,2}:\\d{1,2}:\\d{1,2},\\d{1,3})\\s(.*)$
agent05.sources.source1.interceptors.interceptor2.serializers = s1 s2 
agent05.sources.source1.interceptors.interceptor2.serializers.s1.name = datetime
agent05.sources.source1.interceptors.interceptor2.serializers.s2.name = content

agent05.sources.source1.interceptors.interceptor3.type = timestamp

agent05.sinks.elasticSearch.type = org.apache.flume.sink.elasticsearch.ElasticSearchSink
agent05.sinks.elasticSearch.timeZone=Asia/Shanghai
agent05.sinks.elasticSearch.channel = sink02
agent05.sinks.elasticSearch.batchSize = 2000
agent05.sinks.elasticSearch.hostNames = 10.31.88.120:9300
agent05.sinks.elasticSearch.indexName = backend_log
agent05.sinks.elasticSearch.indexType = static
agent05.sinks.elasticSearch.clusterName = elasticsearch-zzb1
agent05.sinks.elasticSearch.client = transport
agent05.sinks.elasticSearch.serializer = org.apache.flume.sink.elasticsearch.ElasticSearchLogStashEventSerializer

# Each sink's type must be defined
agent05.sinks.loggerSink.type = logger

#Specify the channel the sink should use
agent05.sinks.loggerSink.channel = sink01

# Each channel's type is defined.
agent05.channels.sink01.type = memory
agent05.channels.sink01.capacity = 10000
agent05.channels.sink01.transactionCapacity = 10000
agent05.channels.sink01.byteCapacityBufferPercentage = 20
agent05.channels.sink01.keep-alive = 30

agent05.channels.sink02.type = file
agent05.channels.sink02.checkpointDir = /data/flume/data/checkpointDir1
agent05.channels.sink02.dataDirs = /data/flume/data/dataDirs1

