Defining the flow
To define the flow within a single agent, you need to link the sources andsinks via a channel. You need to list the sources, sinks and channels for thegiven agent, and then point the source and sink to a channel. A source instancecan specify multiple channels, but a sink instance can only specify one channel.The format is as follows:
- # list the sources, sinks and channels for the agent
- <Agent>.sources = <Source>
- <Agent>.sinks = <Sink>
- <Agent>.channels = <Channel1> <Channel2>
- # set channel for source
- <Agent>.sources.<Source>.channels = <Channel1> <Channel2> ...
- # set channel for sink
- <Agent>.sinks.<Sink>.channel = <Channel1>
For example, an agent named agent_foo is reading data from an external avro client and sendingit to HDFS via a memory channel. The config file weblog.config could look like:
- # list the sources, sinks and channels for the agent
- agent_foo.sources = avro-appserver-src-1
- agent_foo.sinks = hdfs-sink-1
- agent_foo.channels = mem-channel-1
- # set channel for source
- agent_foo.sources.avro-appserver-src-1.channels = mem-channel-1
- # set channel for sink
- agent_foo.sinks.hdfs-sink-1.channel = mem-channel-1
This will make the events flow from avro-AppSrv-source to hdfs-Cluster1-sinkthrough the memory channel mem-channel-1. When the agent is started with theweblog.config as its config file, it will instantiate that flow.