Exec
The exec input plugin, allows to execute external program and collects event logs.

Configuration Parameters

The plugin supports the following configuration parameters:
Key
Description
Command
The command to execute.
Parser
Specify the name of a parser to interpret the entry as a structured message.
Interval_Sec
Polling interval (seconds).
Interval_NSec
Polling interval (nanosecond).
Buf_Size
Size of the buffer (check unit sizes for allowed values)

Getting Started

You can run the plugin from the command line or through the configuration file:

Command Line

The following example will read events from the output of ls.
1
$ fluent-bit -i exec -p 'command=ls /var/log' -o stdout
2
Fluent Bit v1.x.x
3
* Copyright (C) 2019-2020 The Fluent Bit Authors
4
* Copyright (C) 2015-2018 Treasure Data
5
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
6
* https://fluentbit.io
7
8
[2018/03/21 17:46:49] [ info] [engine] started
9
[0] exec.0: [1521622010.013470159, {"exec"=>"ConsoleKit"}]
10
[1] exec.0: [1521622010.013490313, {"exec"=>"Xorg.0.log"}]
11
[2] exec.0: [1521622010.013492079, {"exec"=>"Xorg.0.log.old"}]
12
[3] exec.0: [1521622010.013493443, {"exec"=>"anaconda.ifcfg.log"}]
13
[4] exec.0: [1521622010.013494707, {"exec"=>"anaconda.log"}]
14
[5] exec.0: [1521622010.013496016, {"exec"=>"anaconda.program.log"}]
15
[6] exec.0: [1521622010.013497225, {"exec"=>"anaconda.storage.log"}]
Copied!

Configuration File

In your main configuration file append the following Input & Output sections:
1
[INPUT]
2
Name exec
3
Tag exec_ls
4
Command ls /var/log
5
Interval_Sec 1
6
Interval_NSec 0
7
Buf_Size 8mb
8
9
[OUTPUT]
10
Name stdout
11
Match *
Copied!
Last modified 8mo ago