Flume【使用篇】04:Flume的高级组件之Source Interceptors

本文介绍了Flume的高级组件——Source Interceptors,包括Timestamp Interceptor、Host Interceptor等类型,强调了Search and Replace Interceptor对原始数据的影响。文中通过一个案例展示了如何利用拦截器按天和数据类型将日志存储到HDFS,通过Regex Extractor Interceptor和Search and Replace Interceptor转换并提取数据类型字段,实现了目录的动态创建和驼峰命名规则。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一、Source Interceptors

接下里我们看一下第一个高级组件,Source Interceptors

系统中已经内置提供了很多Source Interceptors
常见的Source Interceptors类型:Timestamp Interceptor、Host Interceptor、Search and Replace Interceptor 、Static Interceptor、Regex Extractor Interceptor 等

1、Timestamp Interceptor:向event中的header里面添加timestamp 时间戳信息
2、Host Interceptor:向event中的header里面添加host属性,host的值为当前机器的主机名或者ip
3、Search and Replace Interceptor:根据指定的规则查询Event中body里面的数据,然后进行替换,这个拦截器会修改event中body的值,也就是会修改原始采集到的数据内容
4、Static Interceptor:向event中的header里面添加固定的key和value
5、Regex Extractor Interceptor:根据指定的规则从Event中的body里面抽取数据,生成key和value,再把key和value添加到header中

根据刚才的分析ÿ

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

做一个有趣的人Zz

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值