Routing

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 ...

Get Apache Flume: Distributed Log Collection for Hadoop now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.