Flume based on channel selector can realize fan-in, fan-out.
The same data source is distributed to different purposes, such as.
The channel selector can be defined on source:
123456789 |
a1.sources=r1 ... a1.channels=c1 c2 ... a1.sources.r1.selector.type=multiplexing a1.sources.r1.selector.header=type a1.sources.r1.selector.mapping.type1=c1 a1.sources.r1.selector.mapping.type2=c2 ... |
But where does this type variable come from?
Workaround:
1. Modify the source code used for the source, apply to the client side, different data types to add different type
2, configure interceptor on the source side, set the variable type by interceptor on the header
Like what:
Use Regex_extractor, the data passed to the processing, extract the type value (if possible, you can add the type value in the client side of the data format, easy to use Regex_extractor extract ).
3, in the source side of the custom interceptor, in interceptor to the processing variable type
From for notes (Wiz)
Flume Channel Selector