Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 32 additions & 15 deletions pipeline/inputs/network-io-metrics.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,38 @@
# Network I/O metrics

The _Network I/O metrics_ (`netif`) input plugin gathers network traffic information of the running system at regular intervals, and reports them.
The _Network I/O metrics_ (`netif`) input plugin gathers network traffic information of the running system at regular intervals, and reports them. This plugin is available only for Linux.

The Network I/O metrics plugin creates metrics that are log-based, such as JSON payload. For Prometheus-based metrics, see the Node Exporter metrics input plugin.
The Network I/O metrics plugin creates metrics that are log-based, such as JSON payload. For Prometheus-based metrics, see the [Node Exporter metrics](node-exporter-metrics.md) input plugin.

## Metrics reported

The following table describes the metrics generated by the plugin. Metric names are prefixed with the interface name (for example, `eth0`):

| Key | Description |
|:-------------------------|:-----------------------------------------------|
| `{interface}.rx.bytes` | Number of bytes received on the interface. |
| `{interface}.rx.packets` | Number of packets received on the interface. |
| `{interface}.rx.errors` | Number of receive errors on the interface. |
| `{interface}.tx.bytes` | Number of bytes transmitted on the interface. |
| `{interface}.tx.packets` | Number of packets transmitted on the interface.|
| `{interface}.tx.errors` | Number of transmit errors on the interface. |

## Configuration parameters

The plugin supports the following configuration parameters:

| Key | Description | Default |
|:----------------|:--------------------------------------------------------------------------------------------------------|:--------|
| `Interface` | Specify the network interface to monitor. For example, `eth0`. | _none_ |
| `Interval_Sec` | Polling interval (seconds). | `1` |
| `Interval_NSec` | Polling interval (nanosecond). | `0` |
| `Verbose` | If true, gather metrics precisely. | `false` |
| `Test_At_Init` | If true, testing if the network interface is valid at initialization. | `false` |
| `Threaded` | Indicates whether to run this input in its own [thread](../../administration/multithreading.md#inputs). | `false` |
| `interface` | Specify the network interface to monitor. For example, `eth0`. | _none_ |
| `interval_nsec` | Polling interval in nanoseconds. | `0` |
| `interval_sec` | Polling interval in seconds. | `1` |
| `test_at_init` | If true, test if the network interface is valid at initialization. | `false` |
| `threaded` | Indicates whether to run this input in its own [thread](../../administration/multithreading.md#inputs). | `false` |
| `verbose` | If true, gather metrics precisely. | `false` |

## Get started

To monitor network traffic from your system, you can run the plugin from the command line or through the configuration file:
To monitor network traffic from your system, you can run the plugin from the command line or through the configuration file.

### Command line

Expand All @@ -29,7 +42,7 @@ Run Fluent Bit using a command similar to the following:
fluent-bit -i netif -p interface=eth0 -o stdout
```

Which returns something the following:
Which returns output similar to the following:

```text
...
Expand All @@ -52,10 +65,12 @@ pipeline:
inputs:
- name: netif
tag: netif
interface: eth0
interval_sec: 1
interval_nsec: 0
interface: eth0

verbose: false
test_at_init: false

outputs:
- name: stdout
match: '*'
Expand All @@ -68,9 +83,11 @@ pipeline:
[INPUT]
Name netif
Tag netif
Interface eth0
Interval_Sec 1
Interval_NSec 0
Interface eth0
Verbose false
Test_At_Init false

[OUTPUT]
Name stdout
Expand All @@ -80,6 +97,6 @@ pipeline:
{% endtab %}
{% endtabs %}

Which calculates using the formula: `Total interval (sec) = Interval_Sec + (Interval_Nsec / 1000000000)`.
Total interval (sec) = `interval_sec` + (`interval_nsec` / 1000000000)

For example: `1.5s = 1s + 500000000ns`
For example: `1.5s` = `1s` + `500000000ns`