The Exec source provides a mechanism to run a command outside 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. Here is an example of the use of this property:
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 that outside applications may perform on that log file. All events are written to the c1
channel. This is an example of one of the workarounds...