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 the exceptions to HDFS. In this configuration you can see events coming in on the source s1
via Avro on port 42424. The event is tested to see if the body contains the text "Exception". If it does, it creates a header key exception
(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 channel c2
via the default selector, where it would be forwarded...