在线精品99_中国九九盗摄偷拍偷看_91免费版在线观看_91.app_91高清视频在线_99热最新网站

Flume Interceptors怎么部署

137次阅读
没有评论

共计 3210 个字符,预计需要花费 9 分钟才能阅读完成。

这篇文章主要介绍“Flume Interceptors 怎么部署”,在日常操作中,相信很多人在 Flume Interceptors 怎么部署问题上存在疑惑,丸趣 TV 小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Flume Interceptors 怎么部署”的疑惑有所帮助!接下来,请跟着丸趣 TV 小编一起来学习吧!

一、Timestamp Interceptor

在 event headers 中,添加 timestamp 标签

[root@hftest0001 conf]# pwd
/opt/apache-flume-1.6.0-bin/conf
[root@hftest0001 conf]# vi s-exec_c-m_s-logger.conf 
agent.sources = exec_tail
agent.channels = memoryChannel
agent.sinks = loggerSink
agent.sources.exec_tail.type = exec
agent.sources.exec_tail.command = tail -F /opt/flume-data/exec-tail.log
agent.sources.exec_tail.channels = memoryChannel
agent.sources.exec_tail.interceptors = i1
agent.sources.exec_tail.interceptors.i1.type = timestamp
#agent.sources.exec_tail.interceptors.i1.preserveExisting = true
agent.sinks.loggerSink.type = logger
#agent.sinks.loggerSink.maxBytesToLog = 1
agent.sinks.loggerSink.channel = memoryChannel
agent.channels.memoryChannel.type = memory
agent.channels.memoryChannel.capacity = 100
=== 结果
Event: { headers:{timestamp=1452668731658} body: 78 78 xx }

二、Host Interceptor

获取 agent 部署那台 server 的 ip 或是 hostname,或添加到 host 标签中

[root@hftest0001 conf]# pwd
/opt/apache-flume-1.6.0-bin/conf
[root@hftest0001 conf]# vi s-exec_c-m_s-logger.conf 
agent.sources.exec_tail.type = exec
agent.sources.exec_tail.command = tail -F /opt/flume-data/exec-tail.log
agent.sources.exec_tail.channels = memoryChannel
agent.sources.exec_tail.interceptors = i1 i2
agent.sources.exec_tail.interceptors.i1.type = timestamp
#agent.sources.exec_tail.interceptors.i1.preserveExisting = true
agent.sources.exec_tail.interceptors.i2.type = host
#agent.sources.exec_tail.interceptors.i2.userIP = false = default:true  设置为 false,则获取的值为 hostname
#agent.sources.exec_tail.interceptors.i2.hostHeader = hostname =  default:header 中 key 为 host, 可以设置更改
#agent.sources.exec_tail.interceptors.i2.preserveExisting = true
agent.sinks.loggerSink.type = logger
#agent.sinks.loggerSink.maxBytesToLog = 1
agent.sinks.loggerSink.channel = memoryChannel
agent.channels.memoryChannel.type = memory
agent.channels.memoryChannel.capacity = 100
=== result 
Event: { headers:{timestamp=1452669139164, host=${ip}} body: 78 78 xx }

三、Static Interceptor

自定义向 header 中添加 k -v: 用途,如想知道 events 是那个 dc 的,那个 country,那个 city。也可以根据这些 header 信息,进行数据分流等等

[root@hftest0001 conf]# pwd
/opt/apache-flume-1.6.0-bin/conf
[root@hftest0001 conf]# vi s-exec_c-m_s-logger.conf 
#agent.sources.exec_tail.interceptors.i2.userIP = false
#agent.sources.exec_tail.interceptors.i2.hostHeader = hostname
#agent.sources.exec_tail.interceptors.i2.preserveExisting = true
agent.sources.exec_tail.interceptors.i3.type = static
agent.sources.exec_tail.interceptors.i3.key = country
agent.sources.exec_tail.interceptors.i3.value = USA
agent.sources.exec_tail.interceptors.i4.type = static
agent.sources.exec_tail.interceptors.i4.key = city
agent.sources.exec_tail.interceptors.i4.value = NEW_YORK

agent.sinks.loggerSink.type = logger #agent.sinks.loggerSink.maxBytesToLog = 1 agent.sinks.loggerSink.channel = memoryChannel agent.channels.memoryChannel.type = memory agent.channels.memoryChannel.capacity = 100 ===  result Event: { headers:{timestamp=1452669538967, host=${IP}, city=NEW_YORK, country=USA} body: 78 78 xx }

到此,关于“Flume Interceptors 怎么部署”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注丸趣 TV 网站,丸趣 TV 小编会继续努力为大家带来更多实用的文章!

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-08-16发表,共计3210字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)
主站蜘蛛池模板: 亚洲国产色图 | 国产精品偷伦视频免费观看了 | 国产高清三级 | 日本亚洲天堂 | 看黄软件免费看在线观看 | 中文字幕一区视频一线 | 美女脱裤子让男人捅 | 尤物在线视频 | 国产激情视频 | 国产三级在线观看视频 | 青青草一区国产97 | 18国产精品白浆在线观看免费 | 亚洲最大色图 | 被群cao的合不拢腿h纯肉视频 | 成人久久18免费网址 | 久久99国产精品免费观看 | 美女张开双腿让男人捅 | 美女视频大全视频a免费九 美女视频大全网站免费 | 久久人人 人人澡 人人澡 | 国产午夜高潮熟女精品av | 欧美私人情侣网站 | 国产午夜亚洲精品午夜鲁丝片 | 一边添奶一边添p好爽视频 一插综合网 | 两个人在线免费视频 | 一边摸一边插 | 久久国产免费直播 | 国产中文久久精品 | 国产欧美日韩精品第三区 | 日本欧美久久久久免费播放网 | 99热这里只有精品1 99热这里只有精品3 | 免费中文熟妇在线影片 | 四虎影视库| 94在线成人免费视频 | 大桥未久亚洲无av码在线 | 午夜影院在线观看免费 | 69pao强力打造免费高清 | 人人妻人人澡人人爽不卡视频 | 久久人与动人物a级毛片 | 美女被爆羞羞视频网站视频 | 呦交小u女国产精品视频 | 久久频这里精品99香蕉久 |