The exec source
The exec source provides a mechanism to run a command outside of Flume and then turn the output into Flume events. To use the exec source, set the type
property to exec
:
agent.sources.s1.type=exec
All sources in Flume are required to specify the list of channels to write events to using the channels
(plural) property. This is a space-separated list of one or more channel names:
agent.sources.s1.channels=c1
The only other required parameter is the command
property, which tells Flume what command to pass to the operating system. For instance:
agent.sources=s1 agent.sources.s1.channels=c1 agent.sources.s1.type=exec agent.sources.s1.command=tail -F /var/log/app.log
Here I have configured a single source s1
for an agent named agent
. The source, an exec source, will tail the /var/log/app.log
file and follow any rotations outside applications may perform on that logfile. All events are written to the c1
channel. This is an example of one of the workarounds for the lack of TailSource in...