The routing of data to different destinations based on content should be fairly straightforward now that you've been introduced to all the various mechanisms in Flume.
The first step is to get the data you want to switch on into a Flume header by means of a source-side interceptor if the header isn't already available. The second step is to use a Multiplexing Channel Selector on that header value to switch the data to an alternate channel.
For instance, let's say you wanted to capture all exceptions to HDFS. In this configuration, you can see events coming in on the s1
source via avro
on port 42424. The event is tested to see whether the body contains the text Exception
. If it does, it creates an exception
header key (with the value of Exception
). This header is used to switch these events to channel c1
, and ultimately, HDFS. If the event didn't match the pattern, it would not have the exception
header and would get passed to the c2
channel via the default selector where it would be...