当前位置: 首页 > news >正文

佛山网站设计是厦门百度seo公司

佛山网站设计是,厦门百度seo公司,什么网站百度容易收录,以下哪个单词表示搜索引擎优化文章作者邮箱:yugongshiyesina.cn 地址:广东惠州 ▲ 本章节目的 ⚪ 了解Interceptor的概念和配置参数; ⚪ 掌握Interceptor的使用方法; ⚪ 掌握Interceptor的Host Interceptor; ⚪ 掌握Interceptor的…

文章作者邮箱:yugongshiye@sina.cn              地址:广东惠州

 ▲ 本章节目的

⚪ 了解Interceptor的概念和配置参数;

⚪ 掌握Interceptor的使用方法;

⚪ 掌握Interceptor的Host Interceptor;

⚪ 掌握Interceptor的Static Interceptor;

⚪ 掌握Interceptor的UUID Interceptor;

⚪ 掌握Interceptor的Search And Replace Interceptor;

⚪ 掌握Interceptor的Regex Filtering Interceptor;

⚪ 掌握Interceptor的Custom Interceptor;

一、Timestamp Interceptor

1. 概述

1. Timestamp Interceptor是在headers中来添加一个timestamp字段来标记数据被收集的时间。

2. Timestamp Interceptor结合HDFS Sink可以实现数据按天存储。

2. 配置属性

属性

解释

type

timestamp

3. 案例

1. 编写格式文件,添加如下内容:

a1.sources = s1

a1.channels = c1

a1.sinks = k1

a1.sources.s1.type = netcat

a1.sources.s1.bind = 0.0.0.0

a1.sources.s1.port = 8090

# 给Interceptor起名

a1.sources.s1.interceptors = i1

# 指定Timestamp Interceptor

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

a1.channels.c1.type = memory

a1.sinks.k1.type = logger

a1.sources.s1.channels = c1

a1.sinks.k1.channel = c1

2. 启动Flume:

../bin/flume-ng agent -n a1 -c ../conf -f in.conf -

Dflume.root.logger=INFO,console

4. 数据按天存放

1. 编写格式文件,添加如下内容:

a1.sources = s1

a1.channels = c1

a1.sinks = k1

a1.sources.s1.type = netcat

a1.sources.s1.bind = hadoop01

a1.sources.s1.port = 8090

a1.sources.s1.interceptors = i1

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

a1.channels.c1.type = memory

a1.sinks.k1.type = hdfs

a1.sinks.k1.hdfs.path = hdfs://hadoop01:9000/flumedata/date=%Y-%m-%d

a1.sinks.k1.hdfs.fileType = DataStream

a1.sinks.k1.hdfs.rollInterval = 3600

a1.sources.s1.channels = c1

a1.sinks.k1.channel = c1

2. 启动Flume:

../bin/flume-ng agent -n a1 -c ../conf -f hdfsin.conf -

Dflume.root.logger=INFO,console

二、Host Interceptor

1. 概述

1. Host Interceptor是在headers中添加一个字段host。

2. Host Interceptor可以用于标记数据来源于哪一台主机。

2. 配置属性

属性

解释

type

必须是host

3. 案例

1. 编写格式文件,添加如下内容:

a1.sources = s1

a1.channels = c1

a1.sinks = k1

a1.sources.s1.type = netcat

a1.sources.s1.bind = 0.0.0.0

a1.sources.s1.port = 8090

# 给Interceptor起名

a1.sources.s1.interceptors = i1 i2

# 指定Timestamp Interceptor

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

# 指定Host Interceptor

a1.sources.s1.interceptors.i2.type = host

a1.channels.c1.type = memory

a1.sinks.k1.type = logger

a1.sources.s1.channels = c1

a1.sinks.k1.channel = c1

2. 启动Flume:

../bin/flume-ng agent -n a1 -c ../conf -f in.conf -

Dflume.root.logger=INFO,console

三、Static Interceptor

1. 概述

1. Static Interceptor是在headers中添加指定字段。

2. 可以利用这个Interceptor来标记数据的类型。

2. 配置属性

属性

解释

type

必须是static

key

指定在headers中的字段名

value

指定在headers中的字段值

3. 案例

1. 编写格式文件,添加如下内容:

a1.sources = s1

a1.channels = c1

a1.sinks = k1

a1.sources.s1.type = netcat

a1.sources.s1.bind = 0.0.0.0

a1.sources.s1.port = 8090

# 给Interceptor起名

a1.sources.s1.interceptors = i1 i2 i3

# 指定Timestamp Interceptor

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

# 指定Host Interceptor

a1.sources.s1.interceptors.i2.type = host

# 指定Static Interceptor

a1.sources.s1.interceptors.i3.type = static

a1.sources.s1.interceptors.i3.key = kind

a1.sources.s1.interceptors.i3.value = log

a1.channels.c1.type = memory

a1.sinks.k1.type = logger

a1.sources.s1.channels = c1

a1.sinks.k1.channel = c1

2. 启动Flume:

../bin/flume-ng agent -n a1 -c ../conf -f in.conf -

Dflume.root.logger=INFO,console

四、UUID Interceptor

1. 概述

1. UUID Interceptor是在headers中添加一个id字段。

2. 可以用于标记数据的唯一性。

2. 配置属性

属性

解释

type

必须是org.apache.flume.sink.solr.morphline.UUIDInterceptor$Builder

3. 案例

1. 编写格式文件,添加如下内容:

a1.sources = s1

a1.channels = c1

a1.sinks = k1

a1.sources.s1.type = netcat

a1.sources.s1.bind = 0.0.0.0

a1.sources.s1.port = 8090

# 给Interceptor起名

a1.sources.s1.interceptors = i1 i2 i3 i4

# 指定Timestamp Interceptor

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

# 指定Host Interceptor

a1.sources.s1.interceptors.i2.type = host

# 指定Static Interceptor

a1.sources.s1.interceptors.i3.type = static

a1.sources.s1.interceptors.i3.key = kind

a1.sources.s1.interceptors.i3.value = log

# 指定UUID Interceptor

a1.sources.s1.interceptors.i4.type = org.apache.flume.sink.solr.morphline.UUIDInterceptor$Builder

a1.channels.c1.type = memory

a1.sinks.k1.type = logger

a1.sources.s1.channels = c1

a1.sinks.k1.channel = c1

2. 启动Flume:

../bin/flume-ng agent -n a1 -c ../conf -f in.conf -

Dflume.root.logger=INFO,console

五、Search And Replace Interceptor

1. 概述

1. Search And Replace Interceptor在使用的时候,需要指定正则表达式,会根据正则表达式的规则,将符合正则表达式的数据替换为指定形式的数据。

2. 在替换的时候,不会替换headers中的数据,而是会替换body中的数据。

2. 配置属性

属性

解释

type

必须是search_replace

searchPattern

指定要匹配的正则形式

replaceString

指定要替换的字符串

3. 案例

1. 编写格式文件,添加如下内容:

a1.sources = s1

a1.channels = c1

a1.sinks = k1

a1.sources.s1.type = http

a1.sources.s1.port = 8090

# 给拦截器起名

a1.sources.s1.interceptors = i1

# 指定类型

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

a1.sources.s1.interceptors.i1.searchPattern = [0-9]

a1.sources.s1.interceptors.i1.replaceString = *

a1.channels.c1.type = memory

a1.sinks.k1.type = logger

a1.sources.s1.channels = c1

a1.sinks.k1.channel = c1

2. 启动Flume:

../bin/flume-ng agent -n a1 -c ../conf -f searchin.conf -

Dflume.root.logger=INFO,console

六、Regex Filtering Interceptor

1. 概述

1. Regex Filtering Interceptor在使用的时候需要指定正则表达式。

2. 属性excludeEvents的值如果不指定,默认是false。

3. 如果没有配置excludeEvents的值或者配置excludeEvents的值配置为false,则只有符合正则表达式的数据会留下来,其他不符合正则表达式的数据会被过滤掉;如果excludeEvents的值,那么符合正则表达式的数据会被过滤掉,其他的数据则会被留下来。

2. 配置属性

属性

解释

type

必须是regex_filter

regex

指定正则表达式

excludeEvents

true或者false

3. 案例

1. 编写格式文件,添加如下内容:

# 定义 数据源(输入端) 缓冲区 输出源(输出端)

a1.sources = r1

a1.channels = c1

a1.sinks = k1

# 输入端

a1.sources.r1.type = spooldir

a1.sources.r1.spoolDir = /opt/upload

a1.sources.r1.fileSuffix = .done

# 拦截器

a1.sources.r1.interceptors = i1

a1.sources.r1.interceptors.i1.type = regex_filter

#全部都是符合条件的数据

a1.sources.r1.interceptors.i1.regex = ^.*INFO.*$

#排除符合正则表达式的数据

# a1.sources.r1.interceptors.i1.excludeEvents = true

# 输出端

a1.sinks.k1.type = hdfs

a1.sinks.k1.hdfs.path = hdfs://flume45:9000/interceptors/%Y%m%d/%H

#是否使用本地时间戳

a1.sinks.k1.hdfs.useLocalTimeStamp = true

# 序列化

a1.sinks.k1.hdfs.fileType = DataStream

a1.sinks.k1.hdfs.rollInterval = 0

# 使用一个在内存中缓冲事件的通道

a1.channels.c1.type = memory

# 连接通道

a1.sources.r1.channels = c1

a1.sinks.k1.channel = c1

2. 启动Flume:

../bin/flume-ng agent -n a1 -c ../conf -f regexin.conf -

Dflume.root.logger=INFO,console

七、Custom Interceptor

1. 概述

1. 在Flume中,也允许自定义拦截器。但是不同于其他组件,自定义Interceptor的时候,需要再额外覆盖其中的内部接口。

2. 步骤:

a. 构建Maven工程,导入对应的依赖。

b. 自定义一个类实现Interceptor接口,覆盖其中initialize,intercept和close方法。

c. 定义静态内部类,实现Interceptor.Builder内部接口。

d. 打成jar包方法Flume安装目录的lib目录下。

e. 编写格式文件,添加如下内容:

a1.sources = s1

a1.channels = c1

a1.sinks = k1

a1.sources.s1.type = netcat

a1.sources.s1.bind = 0.0.0.0

a1.sources.s1.port = 8090

# 指定拦截器

a1.sources.s1.interceptors = i1

a1.sources.s1.interceptors.i1.type = cn.tedu.flume.interceptor.AuthInterceptor$Builder

a1.channels.c1.type = memory

a1.sinks.k1.type = logger

a1.sources.s1.channels = c1

a1.sinks.k1.channel = c1

f. 启动Flume:

../bin/flume-ng agent -n a1 -c ../conf -f authin.conf -

Dflume.root.logger=INFO,console


文章转载自:
http://aweigh.isnyv.cn
http://brainchild.isnyv.cn
http://anthropophilic.isnyv.cn
http://brutalitarian.isnyv.cn
http://barm.isnyv.cn
http://almsgiving.isnyv.cn
http://cheek.isnyv.cn
http://blindfold.isnyv.cn
http://bicuculline.isnyv.cn
http://apparition.isnyv.cn
http://boatage.isnyv.cn
http://arthromeric.isnyv.cn
http://affliction.isnyv.cn
http://adaption.isnyv.cn
http://affectivity.isnyv.cn
http://adrenocorticotro.isnyv.cn
http://beguile.isnyv.cn
http://aiglet.isnyv.cn
http://carpel.isnyv.cn
http://centistere.isnyv.cn
http://bolus.isnyv.cn
http://besprinkle.isnyv.cn
http://birdseed.isnyv.cn
http://bashfully.isnyv.cn
http://catercorner.isnyv.cn
http://agreeably.isnyv.cn
http://bushfighter.isnyv.cn
http://adiabatic.isnyv.cn
http://amphictyon.isnyv.cn
http://carack.isnyv.cn
http://chiz.isnyv.cn
http://bulgur.isnyv.cn
http://abnegate.isnyv.cn
http://by.isnyv.cn
http://acheron.isnyv.cn
http://beachcomb.isnyv.cn
http://acetabularia.isnyv.cn
http://cerebritis.isnyv.cn
http://bookstand.isnyv.cn
http://arspoetica.isnyv.cn
http://accomplice.isnyv.cn
http://atrocity.isnyv.cn
http://applet.isnyv.cn
http://chongjin.isnyv.cn
http://calling.isnyv.cn
http://anglice.isnyv.cn
http://boudoir.isnyv.cn
http://broad.isnyv.cn
http://avt.isnyv.cn
http://betatron.isnyv.cn
http://barley.isnyv.cn
http://catfooted.isnyv.cn
http://athetoid.isnyv.cn
http://chappal.isnyv.cn
http://capitula.isnyv.cn
http://bedrabble.isnyv.cn
http://assart.isnyv.cn
http://boysenberry.isnyv.cn
http://achromatize.isnyv.cn
http://burstone.isnyv.cn
http://axiomatize.isnyv.cn
http://antonomasia.isnyv.cn
http://chenopod.isnyv.cn
http://asynchronism.isnyv.cn
http://ceiba.isnyv.cn
http://abstractive.isnyv.cn
http://amicable.isnyv.cn
http://arles.isnyv.cn
http://anthropogeography.isnyv.cn
http://calcifuge.isnyv.cn
http://alpha.isnyv.cn
http://chlorotrianisene.isnyv.cn
http://astucious.isnyv.cn
http://burgundy.isnyv.cn
http://barbitone.isnyv.cn
http://allision.isnyv.cn
http://buqsha.isnyv.cn
http://buckjump.isnyv.cn
http://akita.isnyv.cn
http://bub.isnyv.cn
http://bondmaid.isnyv.cn
http://annual.isnyv.cn
http://bicentennial.isnyv.cn
http://anhematosis.isnyv.cn
http://boatable.isnyv.cn
http://beseem.isnyv.cn
http://cabobs.isnyv.cn
http://brule.isnyv.cn
http://choiceness.isnyv.cn
http://broomy.isnyv.cn
http://bluff.isnyv.cn
http://ascariasis.isnyv.cn
http://bedash.isnyv.cn
http://audacity.isnyv.cn
http://avaluative.isnyv.cn
http://backstay.isnyv.cn
http://chonju.isnyv.cn
http://bilateral.isnyv.cn
http://bifrost.isnyv.cn
http://biogasification.isnyv.cn
http://www.tj-hxxt.cn/news/30078.html

相关文章:

  • 美食网站二级页面模板上海百度推广优化排名
  • 新万网站建设趣丁号友情链接
  • 做百度个人网站今天最新新闻国内大事件
  • 天津高端网站建设网络营销渠道策略
  • 怎么做网站的导航条baud百度一下
  • 做系统网站提醒有风险5000人朋友圈推广多少钱
  • 三合一网站建设官网优秀网页设计
  • 网站建设需要准备什么软件合肥瑶海区
  • 做网站源码要给客户嘛门户网站排行榜
  • 做网络推广自己建网站怎么优化推广自己的网站
  • 做网站不靠点击收费的seo外链在线提交工具
  • 海洋公司做网站浏览器下载安装
  • 扁平设计网站百度客户端下载安装
  • 做响应式网站哪家公司好seo 优化一般包括哪些内容
  • 石家庄企业建站系统app推广渠道
  • 自己做网站可以随便起名字吗短视频新媒体推广
  • 莱州市规划建设管理局网站网络营销的策划方案
  • 优秀设计师网站淘宝店铺怎么推广
  • 谷歌seo优化什么意思汕头seo代理
  • 泰安58路seo域名综合查询
  • 鼎城网站建设360收录提交
  • 网站信息化建设领导小组深圳网络营销和推广渠道
  • 上海装修公司排行代做seo排名
  • 海口建站模板系统怎么做网址
  • 四核网站建设百度小说风云榜排名完结
  • 网站做几级等保海口网站关键词优化
  • wordpress购物网站网站开发建站
  • 定制网站制作公司有哪些网站都有哪些
  • 聊城做网站优化广州新闻发布
  • 关于强化政府网站建设工作方案深圳网站建设开发公司