backend.log.conf 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. agent05.sources = source1
  2. agent05.channels = sink01 sink02
  3. agent05.sinks = elasticSearch
  4. ####source1######
  5. agent05.sources.source1.type = exec
  6. agent05.sources.source1.command = tail -F /var/prog/backend/logs/backend.log
  7. agent05.sources.source1.restart = true
  8. agent05.sources.source1.logStdErr = true
  9. agent05.sources.source1.batchSize = 500
  10. agent05.sources.source1.channels = sink02
  11. agent05.sources.source1.interceptors = interceptor1 interceptor2 interceptor3
  12. agent05.sources.source1.interceptors.interceptor1.type = host
  13. agent05.sources.source1.interceptors.interceptor1.hostHeader = host
  14. agent05.sources.source1.interceptors.interceptor2.type = regex_extractor
  15. 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(.*)$
  16. agent05.sources.source1.interceptors.interceptor2.serializers = s1 s2
  17. agent05.sources.source1.interceptors.interceptor2.serializers.s1.name = datetime
  18. agent05.sources.source1.interceptors.interceptor2.serializers.s2.name = content
  19. agent05.sources.source1.interceptors.interceptor3.type = timestamp
  20. agent05.sinks.elasticSearch.type = org.apache.flume.sink.elasticsearch.ElasticSearchSink
  21. agent05.sinks.elasticSearch.timeZone=Asia/Shanghai
  22. agent05.sinks.elasticSearch.channel = sink02
  23. agent05.sinks.elasticSearch.batchSize = 2000
  24. agent05.sinks.elasticSearch.hostNames = 10.31.88.120:9300
  25. agent05.sinks.elasticSearch.indexName = backend_log
  26. agent05.sinks.elasticSearch.indexType = static
  27. agent05.sinks.elasticSearch.clusterName = elasticsearch-zzb1
  28. agent05.sinks.elasticSearch.client = transport
  29. agent05.sinks.elasticSearch.serializer = org.apache.flume.sink.elasticsearch.ElasticSearchLogStashEventSerializer
  30. # Each sink's type must be defined
  31. agent05.sinks.loggerSink.type = logger
  32. #Specify the channel the sink should use
  33. agent05.sinks.loggerSink.channel = sink01
  34. # Each channel's type is defined.
  35. agent05.channels.sink01.type = memory
  36. agent05.channels.sink01.capacity = 10000
  37. agent05.channels.sink01.transactionCapacity = 10000
  38. agent05.channels.sink01.byteCapacityBufferPercentage = 20
  39. agent05.channels.sink01.keep-alive = 30
  40. agent05.channels.sink02.type = file
  41. agent05.channels.sink02.checkpointDir = /data/flume/data/checkpointDir1
  42. agent05.channels.sink02.dataDirs = /data/flume/data/dataDirs1