From 2d252f46b99f9804ac2d5122eccb401ce2694b72 Mon Sep 17 00:00:00 2001 From: "Eric D. Schabell" Date: Tue, 9 Dec 2025 16:23:28 +0100 Subject: [PATCH] input: network_io_metrics: general documentation improvements - Add "Metrics reported" section with table of output metrics - Add Linux platform availability note - Add hyperlink to Node Exporter metrics plugin - Add verbose and test_at_init options to YAML and conf examples - Standardize config parameter names to lowercase - Sort configuration parameters alphabetically - Fix grammar: "returns something the following" -> "returns output similar to the following" - Improve consistency with other input plugin docs Fixes #2284. Signed-off-by: Eric D. Schabell --- pipeline/inputs/network-io-metrics.md | 47 ++++++++++++++++++--------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/pipeline/inputs/network-io-metrics.md b/pipeline/inputs/network-io-metrics.md index f36aad3ec..dde0d888a 100644 --- a/pipeline/inputs/network-io-metrics.md +++ b/pipeline/inputs/network-io-metrics.md @@ -1,8 +1,21 @@ # 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 @@ -10,16 +23,16 @@ 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 @@ -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 ... @@ -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: '*' @@ -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 @@ -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` \ No newline at end of file +For example: `1.5s` = `1s` + `500000000ns`