flume中3大高级组件,Flume Interceptors:拦截器,Flume Channel Selectors :选择器 ,Flume Sink Processors(sink的处理器)

flume中3大高级组件

Flume Interceptors:拦截器,与Spring中拦截器是类似

功能:通过拦截器对每条数据进行过滤护着包装

Timestamp Interceptor:时间拦截器

在每一个event的头部添加一个KeyValue

       key: timestamp

       value:当前封装event的时间


# The configuration file needs to define the sources, 
# the channels and the sinks.
# Sources, channels and sinks are defined per a1, 
# in this case called 'a1'

a1.sources = s1
a1.channels = c1 
a1.sinks = k1 

# defined sources
#如果是自己编译的类,这里写类的全路径
a1.sources.s1.type=exec
a1.sources.s1.command= tail -F /opt/datas/wordcount
a1.sources.s1.shell=/bin/sh -c

a1.sources.s1.interceptors=i1
a1.sources.s1.interceptors.i1.type=timestamp






#define channel  
a1.channels.c1.type=memory

#设置检查点,  记录相关传输的信息,比如取了多少event

#容量
a1.channels.c1.capacity=1000
#瓶口大小
a1.channels.c1.transactionCapacity=100


#defined sinks
a1.sinks.k1.type=logger

#bond
a1.sources.s1.channels = c1 
a1.sinks.k1.channel = c1




 

Host Interceptor:主机名拦截器

       在每一个event的头部添加一个KeyValue

       key: host

       value:当前封装event所在机器的主机名


# The configuration file needs to define the sources, 
# the channels and the sinks.
# Sources, channels and sinks are defined per a1, 
# in this case called 'a1'

a1.sources = s1
a1.channels = c1 
a1.sinks = k1 

# defined sources
#如果是自己编译的类,这里写类的全路径
a1.sources.s1.type=exec
a1.sources.s1.command= tail -F /opt/datas/wordcount
a1.sources.s1.shell=/bin/sh -c

a1.sources.s1.interceptors=i1
a1.sources.s1.interceptors.i1.type  =  host 
a1.sources.s1.interceptors.i1.hostHeader  =  hostname




#define channel  
a1.channels.c1.type=memory

#设置检查点,  记录相关传输
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值