Flume Interceptors怎么部署
发表于:2025-12-03 作者:千家信息网编辑
千家信息网最后更新 2025年12月03日,这篇文章主要介绍"Flume Interceptors怎么部署",在日常操作中,相信很多人在Flume Interceptors怎么部署问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希
千家信息网最后更新 2025年12月03日Flume Interceptors怎么部署
这篇文章主要介绍"Flume Interceptors怎么部署",在日常操作中,相信很多人在Flume Interceptors怎么部署问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答"Flume Interceptors怎么部署"的疑惑有所帮助!接下来,请跟着小编一起来学习吧!
一、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_tailagent.channels = memoryChannelagent.sinks = loggerSinkagent.sources.exec_tail.type = execagent.sources.exec_tail.command = tail -F /opt/flume-data/exec-tail.logagent.sources.exec_tail.channels = memoryChannelagent.sources.exec_tail.interceptors = i1agent.sources.exec_tail.interceptors.i1.type = timestamp#agent.sources.exec_tail.interceptors.i1.preserveExisting = trueagent.sinks.loggerSink.type = logger#agent.sinks.loggerSink.maxBytesToLog = 1agent.sinks.loggerSink.channel = memoryChannelagent.channels.memoryChannel.type = memoryagent.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 = execagent.sources.exec_tail.command = tail -F /opt/flume-data/exec-tail.logagent.sources.exec_tail.channels = memoryChannelagent.sources.exec_tail.interceptors = i1 i2agent.sources.exec_tail.interceptors.i1.type = timestamp#agent.sources.exec_tail.interceptors.i1.preserveExisting = trueagent.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 = trueagent.sinks.loggerSink.type = logger#agent.sinks.loggerSink.maxBytesToLog = 1agent.sinks.loggerSink.channel = memoryChannelagent.channels.memoryChannel.type = memoryagent.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 = trueagent.sources.exec_tail.interceptors.i3.type = staticagent.sources.exec_tail.interceptors.i3.key = countryagent.sources.exec_tail.interceptors.i3.value = USAagent.sources.exec_tail.interceptors.i4.type = staticagent.sources.exec_tail.interceptors.i4.key = cityagent.sources.exec_tail.interceptors.i4.value = NEW_YORKagent.sinks.loggerSink.type = logger#agent.sinks.loggerSink.maxBytesToLog = 1agent.sinks.loggerSink.channel = memoryChannelagent.channels.memoryChannel.type = memoryagent.channels.memoryChannel.capacity = 100===> resultEvent: { headers:{timestamp=1452669538967, host=${IP}, city=NEW_YORK, country=USA} body: 78 78 xx }到此,关于"Flume Interceptors怎么部署"的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注网站,小编会继续努力为大家带来更多实用的文章!
学习
更多
标签
帮助
实用
接下来
信息
数据
文章
方法
理论
用途
知识
篇文章
结果
网站
资料
跟着
问题
好用
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
数字与网络技术是干什么的
浦东新区公司软件开发市场
迪岸网络技术上海
新乡职业技术学院网络安全
战地五服务器有什么要求吗
网络安全从我做起小报
网络安全硕博论文
海康存储服务器默认管理地址
数据库稳定指标
数据库操作命令题
现代信息技术和网络技术
数据库设计表格展示
一台大型网游服务器要多少钱
服务器架设与管理实验报告
安可数据库名录
武汉财务软件开发团队
长沙软件开发专科学校有哪些
海曙直销软件开发外包
mysql数据库是什么专业的
杨浦区车载网络技术口碑推荐
幼儿园网络安全无事故说明
dell服务器电池如何抠下来
图关系在数据库中怎么存储
濮阳政务软件开发定制
怎么设置数据库有效性
网络安全竞赛绿盟杯
如何防范网络安全软硬件因素
传达网络安全审查办法
万方数据库 费用
福州 海迅 网络技术