Skip to content

Commit 00bb8cb

Browse files
committed
pipeline: input: migrate docs
Signed-off-by: Eduardo Silva <eduardo@treasure-data.com>
1 parent b78cfe9 commit 00bb8cb

25 files changed

+1481
-15
lines changed

SUMMARY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
* [Inputs](pipeline/inputs/README.md)
6363
* [Collectd](pipeline/inputs/collectd.md)
6464
* [CPU Metrics](pipeline/inputs/cpu-metrics.md)
65-
* [Disk I/O Metrics](pipeline/inputs/disk-i-o-metrics.md)
65+
* [Disk I/O Metrics](pipeline/inputs/disk-io-metrics.md)
6666
* [Dummy](pipeline/inputs/dummy.md)
6767
* [Exec](pipeline/inputs/exec.md)
6868
* [Forward](pipeline/inputs/forward.md)
@@ -71,7 +71,7 @@
7171
* [Kernel Logs](pipeline/inputs/kernel-logs.md)
7272
* [Memory Metrics](pipeline/inputs/memory-metrics.md)
7373
* [MQTT](pipeline/inputs/mqtt.md)
74-
* [Network I/O Metrics](pipeline/inputs/network-i-o-metrics.md)
74+
* [Network I/O Metrics](pipeline/inputs/network-io-metrics.md)
7575
* [Process](pipeline/inputs/process.md)
7676
* [Random](pipeline/inputs/random.md)
7777
* [Serial Interface](pipeline/inputs/serial-interface.md)

pipeline/inputs/collectd.md

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,40 @@
1-
---
2-
description: example...
3-
---
4-
51
# Collectd
62

3+
The **collectd** input plugin allows you to receive datagrams from collectd.
4+
5+
Content:
6+
7+
* [Configuration Parameters](collectd.md#config)
8+
* [Configuration Examples](collectd.md#config_example)
9+
10+
## Configuration Parameters {#config}
11+
12+
The plugin supports the following configuration parameters:
13+
14+
| Key | Description | Default |
15+
| :------- | :------------------------------ | :--------------------------- |
16+
| Listen | Set the address to listen to | 0.0.0.0 |
17+
| Port | Set the port to listen to | 25826 |
18+
| TypesDB | Set the data specification file | /usr/share/collectd/types.db |
19+
20+
## Configuration Examples {#config_example}
21+
22+
Here is a basic configuration example.
23+
24+
```python
25+
[INPUT]
26+
Name collectd
27+
Listen 0.0.0.0
28+
Port 25826
29+
TypesDB /usr/share/collectd/types.db,/etc/collectd/custom.db
30+
31+
[OUTPUT]
32+
Name stdout
33+
Match *
34+
```
35+
36+
With this configuration, fluent-bit listens to `0.0.0.0:25826`, and
37+
outputs incoming datagram packets to stdout.
38+
39+
You must set the same types.db files that your collectd server uses.
40+
Otherwise, fluent-bit may not be able to interpret the payload properly.

pipeline/inputs/cpu-metrics.md

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,64 @@
1-
# CPU Metrics
1+
# CPU Usage
2+
3+
The **cpu** input plugin, measures the CPU usage of a process or the whole system by default (considering per CPU core). It reports values in percentage unit for every interval of time set. At the moment this plugin is only available for Linux.
4+
5+
The following tables describes the information generated by the plugin. The keys below represent the data used by the overall system, all values associated to the keys are in a percentage unit \(0 to 100%\):
6+
7+
| key | description |
8+
| :--- | :--- |
9+
| cpu\_p | CPU usage of the overall system, this value is the summatory of time spent on user and kernel space. The result takes in consideration the numbers of CPU cores in the system. |
10+
| user\_p | CPU usage in User mode, for short it means the CPU usage by user space programs. The result of this value takes in consideration the numbers of CPU cores in the system. |
11+
| system\_p | CPU usage in Kernel mode, for short it means the CPU usage by the Kernel. The result of this value takes in consideration the numbers of CPU cores in the system. |
12+
13+
In addition to the keys reported in the above table, a similar content is created **per** CPU core. The cores are listed from _0_ to _N_ as the Kernel reports:
14+
15+
| key | description |
16+
| :--- | :--- |
17+
| cpu**N**.p\_cpu | Represents the total CPU usage by core **N**. |
18+
| cpu**N**.p\_user | Total CPU spent in user mode or user space programs associated to this core. |
19+
| cpu**N**.p\_system | Total CPU spent in system or kernel mode associated to this core. |
20+
21+
## Configuration Parameters
22+
23+
The plugin supports the following configuration parameters:
24+
25+
| Key | Description | Default |
26+
| :--- | :--- | ---- |
27+
| Interval\_Sec | Polling interval in seconds | 1 |
28+
| Interval\_NSec | Polling interval in nanoseconds | 0 |
29+
| PID | Specify the ID (PID) of a running process in the system. By default the plugin monitors the whole system but if this option is set, it will only monitor the given process ID. | |
30+
31+
## Getting Started
32+
33+
In order to get the statistics of the CPU usage of your system, you can run the plugin from the command line or through the configuration file:
34+
35+
### Command Line
36+
37+
```bash
38+
$ build/bin/fluent-bit -i cpu -t my_cpu -o stdout -m '*'
39+
Fluent-Bit v1.x.x
40+
Copyright (C) Treasure Data
41+
42+
[2019/09/02 10:46:29] [ info] starting engine
43+
[0] [1452185189, {"cpu_p"=>7.00, "user_p"=>5.00, "system_p"=>2.00, "cpu0.p_cpu"=>10.00, "cpu0.p_user"=>8.00, "cpu0.p_system"=>2.00, "cpu1.p_cpu"=>6.00, "cpu1.p_user"=>4.00, "cpu1.p_system"=>2.00}]
44+
[1] [1452185190, {"cpu_p"=>6.50, "user_p"=>5.00, "system_p"=>1.50, "cpu0.p_cpu"=>6.00, "cpu0.p_user"=>5.00, "cpu0.p_system"=>1.00, "cpu1.p_cpu"=>7.00, "cpu1.p_user"=>5.00, "cpu1.p_system"=>2.00}]
45+
[2] [1452185191, {"cpu_p"=>7.50, "user_p"=>5.00, "system_p"=>2.50, "cpu0.p_cpu"=>7.00, "cpu0.p_user"=>3.00, "cpu0.p_system"=>4.00, "cpu1.p_cpu"=>6.00, "cpu1.p_user"=>6.00, "cpu1.p_system"=>0.00}]
46+
[3] [1452185192, {"cpu_p"=>4.50, "user_p"=>3.50, "system_p"=>1.00, "cpu0.p_cpu"=>6.00, "cpu0.p_user"=>5.00, "cpu0.p_system"=>1.00, "cpu1.p_cpu"=>5.00, "cpu1.p_user"=>3.00, "cpu1.p_system"=>2.00}]
47+
```
48+
49+
As described above, the CPU input plugin gathers the overall usage every one second and flushed the information to the output on the fifth second. On this example we used the **stdout** plugin to demonstrate the output records. In a real use-case you may want to flush this information to some central aggregator such as [Fluentd](http://fluentd.org) or [Elasticsearch](http://elastic.co).
50+
51+
### Configuration File
52+
53+
In your main configuration file append the following _Input_ & _Output_ sections:
54+
55+
```python
56+
[INPUT]
57+
Name cpu
58+
Tag my_cpu
59+
60+
[OUTPUT]
61+
Name stdout
62+
Match *
63+
```
264

pipeline/inputs/disk-i-o-metrics.md

Lines changed: 0 additions & 2 deletions
This file was deleted.

pipeline/inputs/disk-io-metrics.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Disk Throughput
2+
3+
The **disk** input plugin, gathers the information about the disk throughput of the running system every certain interval of time and reports them.
4+
5+
## Configuration Parameters
6+
7+
The plugin supports the following configuration parameters:
8+
9+
| Key | Description |
10+
| :--- | :--- |
11+
| Interval\_Sec | Polling interval \(seconds\). default: 1 |
12+
| Interval\_NSec | Polling interval \(nanosecond\). default: 0 |
13+
| Dev\_Name | Device name to limit the target. \(e.g. sda\). If not set, _in\_disk_ gathers information from all of disks and partitions. |
14+
15+
## Getting Started
16+
17+
In order to get disk usage from your system, you can run the plugin from the command line or through the configuration file:
18+
19+
### Command Line
20+
21+
```bash
22+
$ fluent-bit -i disk -o stdout
23+
Fluent-Bit v0.11.0
24+
Copyright (C) Treasure Data
25+
26+
[2017/01/28 16:58:16] [ info] [engine] started
27+
[0] disk.0: [1485590297, {"read_size"=>0, "write_size"=>0}]
28+
[1] disk.0: [1485590298, {"read_size"=>0, "write_size"=>0}]
29+
[2] disk.0: [1485590299, {"read_size"=>0, "write_size"=>0}]
30+
[3] disk.0: [1485590300, {"read_size"=>0, "write_size"=>11997184}]
31+
```
32+
33+
### Configuration File
34+
35+
In your main configuration file append the following _Input_ & _Output_ sections:
36+
37+
```python
38+
[INPUT]
39+
Name disk
40+
Tag disk
41+
Interval_Sec 1
42+
Interval_NSec 0
43+
[OUTPUT]
44+
Name stdout
45+
Match *
46+
```
47+
48+
Note: Total interval \(sec\) = Interval\_Sec + \(Interval\_Nsec / 1000000000\).
49+
50+
e.g. 1.5s = 1s + 500000000ns
51+

pipeline/inputs/dummy.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,45 @@
11
# Dummy
22

3+
The **dummy** input plugin, generates dummy events. It is useful for testing, debugging, benchmarking and getting started with Fluent Bit.
4+
5+
## Configuration Parameters
6+
7+
The plugin supports the following configuration parameters:
8+
9+
## Getting Started
10+
11+
You can run the plugin from the command line or through the configuration file:
12+
13+
| Key | Description |
14+
| :--- | :--- |
15+
| Dummy | Dummy JSON record. Default: `{"message":"dummy"}` |
16+
| Rate | Events number generated per second. Default: 1 |
17+
18+
### Command Line
19+
20+
```bash
21+
$ fluent-bit -i dummy -o stdout
22+
Fluent-Bit v0.12.0
23+
Copyright (C) Treasure Data
24+
25+
[2017/07/06 21:55:29] [ info] [engine] started
26+
[0] dummy.0: [1499345730.015265366, {"message"=>"dummy"}]
27+
[1] dummy.0: [1499345731.002371371, {"message"=>"dummy"}]
28+
[2] dummy.0: [1499345732.000267932, {"message"=>"dummy"}]
29+
[3] dummy.0: [1499345733.000757746, {"message"=>"dummy"}]
30+
```
31+
32+
### Configuration File
33+
34+
In your main configuration file append the following _Input_ & _Output_ sections:
35+
36+
```python
37+
[INPUT]
38+
Name dummy
39+
Tag dummy.log
40+
41+
[OUTPUT]
42+
Name stdout
43+
Match *
44+
```
45+

pipeline/inputs/exec.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,57 @@
11
# Exec
22

3+
The **exec** input plugin, allows to execute external program and collects event logs.
4+
5+
## Configuration Parameters
6+
7+
The plugin supports the following configuration parameters:
8+
9+
| Key | Description |
10+
| :--- | :--- |
11+
| Command | The command to execute. |
12+
| Parser | Specify the name of a parser to interpret the entry as a structured message. |
13+
| Interval\_Sec | Polling interval \(seconds\). |
14+
| Interval\_NSec | Polling interval \(nanosecond\). |
15+
| Buf\_Size | Size of the buffer (check [unit sizes](https://docs.fluentbit.io/manual/configuration/unit_sizes) for allowed values) |
16+
17+
## Getting Started
18+
19+
You can run the plugin from the command line or through the configuration file:
20+
21+
### Command Line
22+
23+
The following example will read events from the output of _ls_.
24+
25+
```bash
26+
$ fluent-bit -i exec -p 'command=ls /var/log' -o stdout
27+
Fluent-Bit v0.13.0
28+
Copyright (C) Treasure Data
29+
30+
[2018/03/21 17:46:49] [ info] [engine] started
31+
[0] exec.0: [1521622010.013470159, {"exec"=>"ConsoleKit"}]
32+
[1] exec.0: [1521622010.013490313, {"exec"=>"Xorg.0.log"}]
33+
[2] exec.0: [1521622010.013492079, {"exec"=>"Xorg.0.log.old"}]
34+
[3] exec.0: [1521622010.013493443, {"exec"=>"anaconda.ifcfg.log"}]
35+
[4] exec.0: [1521622010.013494707, {"exec"=>"anaconda.log"}]
36+
[5] exec.0: [1521622010.013496016, {"exec"=>"anaconda.program.log"}]
37+
[6] exec.0: [1521622010.013497225, {"exec"=>"anaconda.storage.log"}]
38+
```
39+
40+
### Configuration File
41+
42+
In your main configuration file append the following _Input_ & _Output_ sections:
43+
44+
```python
45+
[INPUT]
46+
Name exec
47+
Tag exec_ls
48+
Command ls /var/log
49+
Interval_Sec 1
50+
Interval_NSec 0
51+
Buf_Size 8mb
52+
53+
[OUTPUT]
54+
Name stdout
55+
Match *
56+
```
57+

pipeline/inputs/forward.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,72 @@
11
# Forward
22

3+
_Forward_ is the protocol used by [Fluent Bit](http://fluentbit.io) and [Fluentd](http://www.fluentd.org) to route messages between peers. This plugin implements the input service to listen for Forward messages.
4+
5+
## Configuration Parameters
6+
7+
The plugin supports the following configuration parameters:
8+
9+
| Key | Description | Default |
10+
| :--- | :--- | :--- |
11+
| Listen | Listener network interface. | 0.0.0.0 |
12+
| Port | TCP port to listen for incoming connections. | 24224 |
13+
| Buffer\_Max\_Size | Specify the maximum buffer memory size used to receive a Forward message. The value must be according to the [Unit Size](../configuration/unit_sizes.md) specification. | _Buffer\_Chunk\_Size_ |
14+
| Buffer\_Chunk\_Size | By default the buffer to store the incoming Forward messages, do not allocate the maximum memory allowed, instead it allocate memory when is required. The rounds of allocations are set by _Buffer\_Chunk\_Size_. The value must be according to the [Unit Size](../configuration/unit_sizes.md) specification. | 32KB |
15+
16+
## Getting Started
17+
18+
In order to receive Forward messages, you can run the plugin from the command line or through the configuration file:
19+
20+
### Command Line
21+
22+
From the command line you can let Fluent Bit listen for _Forward_ messages with the following options:
23+
24+
```bash
25+
$ fluent-bit -i forward -o stdout
26+
```
27+
28+
By default the service will listen an all interfaces \(0.0.0.0\) through TCP port 24224, optionally you can change this directly, e.g:
29+
30+
```bash
31+
$ fluent-bit -i forward://192.168.3.2:9090 -o stdout
32+
```
33+
34+
In the example the Forward messages will only arrive through network interface under 192.168.3.2 address and TCP Port 9090.
35+
36+
### Configuration File
37+
38+
In your main configuration file append the following _Input_ & _Output_ sections:
39+
40+
```python
41+
[INPUT]
42+
Name forward
43+
Listen 0.0.0.0
44+
Port 24224
45+
Buffer_Chunk_Size 32KB
46+
Buffer_Max_Size 64KB
47+
48+
[OUTPUT]
49+
Name stdout
50+
Match *
51+
```
52+
53+
## Testing
54+
55+
Once Fluent Bit is running, you can send some messages using the _fluent-cat_ tool \(this tool is provided by [Fluentd](http://www.fluentd.org):
56+
57+
```bash
58+
$ echo '{"key 1": 123456789, "key 2": "abcdefg"}' | fluent-cat my_tag
59+
```
60+
61+
In [Fluent Bit](http://fluentbit.io) we should see the following output:
62+
63+
```bash
64+
$ bin/fluent-bit -i forward -o stdout
65+
Fluent-Bit v0.9.0
66+
Copyright (C) Treasure Data
67+
68+
[2016/10/07 21:49:40] [ info] [engine] started
69+
[2016/10/07 21:49:40] [ info] [in_fw] binding 0.0.0.0:24224
70+
[0] my_tag: [1475898594, {"key 1"=>123456789, "key 2"=>"abcdefg"}]
71+
```
72+

0 commit comments

Comments
 (0)