flume:flume分区和拦截器

一、分区:

    将查询限制在某个分区内。

    将数据存储的方式更改为分区存储方式:

        对hdfs.path进行设置。

        举个例子:

            agent1.sinks.sink1.hdfs.path = /usr/logs/year=%Y/month=%m/day=%d'

二、拦截器 :

    使用interceptors声明拦截器

    举个例子:

            agent1.sources.source1.interceptors = interceptor1

            agent1.sources.source1.interceptors.interceptor1.type = timestamp

    这个拦截器的类型是时间戳,就是在事件header中添加时间戳。

    interceptors类型如下:

            1.Host

            2.Morphline

            3.Regex extractor

            4.Regex filtering

            5.Static

            6.timestamp

            7.uuid

你可能感兴趣的:(flume)