配置:file-flume-kafka.conf
flume中主要用到的就是配置文件
com.bigdata.flume.interceptor.LogETLInterceptor和com.bigdata.flume.interceptor.LogTypeInterceptor是自定义的拦截器的全类名。需要根据用户自定义的拦截器做相应修改。
拦截器:它的里面有两个自定义的拦截器,一个是数据清洗的拦截器,一个是日志类型的拦截器。
拦截器就相当于map,有kv值。
key :就是头,给他个名字叫做topic ,value:里面放着日志类型satrt和event。发往channle
a1.sources=r1
a1.channels=c1 c2 #组件定义
# configure source
a1.sources.r1.type = TAILDIR #taildir方式读取数据
a1.sources.r1.positionFile = /opt/module/flume/test/log_position.json #记录日志读取位置
a1.sources.r1.filegroups = f1
a1.sources.r1.filegroups.f1 = /tmp/logs/app.+ #读取日志位置
a1.sources.r1.fileHeader = true
a1.sources.r1.channels = c1 c2
#interceptor
a1.sources.r1.interceptors = i1 i2
a1.sources.r1.inter