三、UUID拦截器
功能:将UUID型的id写入headers
1.配置flume-UUID拦截器的配置文件:
flume-uuid.conf
|
a1.sources = r1 a1.sinks = k1 a1.channels = c1
a1.sources.r1.type = exec a1.sources.r1.command = tail -F /opt/plus
#UUID拦截器 a1.sources.r1.interceptors = i1 #type的参数不能写成uuid,得写具体,否则找不到类 a1.sources.r1.interceptors.i1.type=org.apache.flume.sink.solr.morphline.UUIDInterceptor$Builder #如果UUID头已经存在,它应该保存 a1.sources.r1.interceptors.i1.preserveExisting = true a1.sources.r1.interceptors.i1.prefix = UUID_
#如果sink类型改为HDFS,那么在HDFS的文本中没有headers的信息数据 a1.sinks.k1.type = logger
a1.channels.c1.type = memory a1.channels.c1.capacity = 1000 a1.channels.c1.transactionCapacity = 100
a1.sources.r1.channels = c1 a1.sinks.k1.channel = c1 |
2.在安排好监控的文件之后,执行该配置文件
执行flume-UUID拦截器
[root@bigdata111 myconf]# flume-ng agent -c ../conf/ -n a1 -f flume-uuid.conf -Dflume.root.logger=INFO,console
3.查看效果

浙公网安备 33010602011771号