閱讀294 返回首頁    go 阿裏雲 go 技術社區[雲棲]


Flume 之 Interceptors

Flume has the capability to modify/drop events in-flight.this done with the help of interceptors. Interceptors are classes that implement org.apache.flume.interceptor interface.An Interceptor can modify or even drop events bases on any criteria chosen by the developer of the interceptor.Flume supports bulider class banes in the configuration the otder in which the interceptors is passed to the next interceptor in th chain terceptors can modify or drop evebts if an interceptor needs to drop events it just does not return that event in the list that it returns if it is drop all events then it simply returns can empty list interceptors ate named components here is an example of how they are created through configuration;

Timestamp interceptor 和Host Interceptor 這兩個攔截器
分別給每個event頭部插入 時間戳 和代理agent的IP

Static Interceptor
允許在event的頭部追加一個靜態的值
Remove Header Interceptor
用於移除頭部靜態定義 如果不符合匹配到標準則不會移除歸結到一點就是看你定義的移除內容
UUID INterceptor
給所有攔截的event 給定一個獨立唯一的身份號碼
Morephline Interceptor
這個攔截器過濾events 通過一個 morphline configuration文件
這個文件定義著一個管式指令鏈

Search and Replace Interceptor
這個攔截器提供了一個子串基礎 查詢替換 的基本功能 通過java的常規表達

Backtracking/group capture is also avaliable.這個攔截器的規則在java的 Matcher.replaceAll()方法.

Regex Filtering Interceptor Regex Extractor Interceptor
正則表達式攔截器 正則表達式提取器
正則表達式匹配對時間
提供的正則表達式可以應用於事件或者排除事件

最後更新:2017-11-07 22:03:38

  上一篇:go  flume列子回想
  下一篇:go  淺談Kubernetes和Docker