From 19c28769ae52f0a82a20bb2b7da35aac70e34453 Mon Sep 17 00:00:00 2001 From: "Eric D. Schabell" Date: Tue, 1 Jul 2025 16:55:48 +0200 Subject: [PATCH] Fixing shell commands, adding YAML standards for memory metrics input plugin docs. Fixes #1817. Signed-off-by: Eric D. Schabell --- pipeline/inputs/memory-metrics.md | 70 +++++++++++++++++++------------ 1 file changed, 43 insertions(+), 27 deletions(-) diff --git a/pipeline/inputs/memory-metrics.md b/pipeline/inputs/memory-metrics.md index 9e2bb3de4..b52c024b8 100644 --- a/pipeline/inputs/memory-metrics.md +++ b/pipeline/inputs/memory-metrics.md @@ -8,26 +8,42 @@ To get memory and swap usage from your system, you can run the plugin from the c ### Command line -Run the following command from the command line: +Run the following command from the command line, noting this is for a Linux machine: -```bash -fluent-bit -i mem -t memory -o stdout -m '*' +```shell +$ fluent-bit -i mem -t memory -o stdout -m '*' ``` Which outputs information similar to: ```text -Fluent Bit v1.x.x -* Copyright (C) 2019-2020 The Fluent Bit Authors -* Copyright (C) 2015-2018 Treasure Data +Fluent Bit v4.0.3 +* Copyright (C) 2015-2025 The Fluent Bit Authors * Fluent Bit is a CNCF sub-project under the umbrella of Fluentd * https://fluentbit.io -[2017/03/03 21:12:35] [ info] [engine] started -[0] memory: [1488543156, {"Mem.total"=>1016044, "Mem.used"=>841388, "Mem.free"=>174656, "Swap.total"=>2064380, "Swap.used"=>139888, "Swap.free"=>1924492}] -[1] memory: [1488543157, {"Mem.total"=>1016044, "Mem.used"=>841420, "Mem.free"=>174624, "Swap.total"=>2064380, "Swap.used"=>139888, "Swap.free"=>1924492}] -[2] memory: [1488543158, {"Mem.total"=>1016044, "Mem.used"=>841420, "Mem.free"=>174624, "Swap.total"=>2064380, "Swap.used"=>139888, "Swap.free"=>1924492}] -[3] memory: [1488543159, {"Mem.total"=>1016044, "Mem.used"=>841420, "Mem.free"=>174624, "Swap.total"=>2064380, "Swap.used"=>139888, "Swap.free"=>1924492}] +______ _ _ ______ _ _ ___ _____ +| ___| | | | | ___ (_) | / || _ | +| |_ | |_ _ ___ _ __ | |_ | |_/ /_| |_ __ __/ /| || |/' | +| _| | | | | |/ _ \ '_ \| __| | ___ \ | __| \ \ / / /_| || /| | +| | | | |_| | __/ | | | |_ | |_/ / | |_ \ V /\___ |\ |_/ / +\_| |_|\__,_|\___|_| |_|\__| \____/|_|\__| \_/ |_(_)___/ + + +[2025/07/01 14:44:47] [ info] [fluent bit] version=4.0.3, commit=f5f5f3c17d, pid=1 +[2025/07/01 14:44:47] [ info] [storage] ver=1.5.3, type=memory, sync=normal, checksum=off, max_chunks_up=128 +[2025/07/01 14:44:47] [ info] [simd ] disabled +[2025/07/01 14:44:47] [ info] [cmetrics] version=1.0.3 +[2025/07/01 14:44:47] [ info] [ctraces ] version=0.6.6 +[2025/07/01 14:44:47] [ info] [input:mem:mem.0] initializing +[2025/07/01 14:44:47] [ info] [input:mem:mem.0] storage_strategy='memory' (memory only) +[2025/07/01 14:44:47] [ info] [sp] stream processor started +[2025/07/01 14:44:47] [ info] [engine] Shutdown Grace Period=5, Shutdown Input Grace Period=2 +[2025/07/01 14:44:47] [ info] [output:stdout:stdout.0] worker #0 started +[0] memory: [[1751381087.225589224, {}], {"Mem.total"=>3986708, "Mem.used"=>560708, "Mem.free"=>3426000, "Swap.total"=>0, "Swap.used"=>0, "Swap.free"=>0}] +[0] memory: [[1751381088.228411537, {}], {"Mem.total"=>3986708, "Mem.used"=>560708, "Mem.free"=>3426000, "Swap.total"=>0, "Swap.used"=>0, "Swap.free"=>0}] +[0] memory: [[1751381089.225600084, {}], {"Mem.total"=>3986708, "Mem.used"=>561480, "Mem.free"=>3425228, "Swap.total"=>0, "Swap.used"=>0, "Swap.free"=>0}] +[0] memory: [[1751381090.228345064, {}], {"Mem.total"=>3986708, "Mem.used"=>561480, "Mem.free"=>3425228, "Swap.total"=>0, "Swap.used"=>0, "Swap.free"=>0}] ``` ## Threading @@ -37,23 +53,9 @@ You can enable the `threaded` setting to run this input in its own ### Configuration file -In your main configuration file append the following `Input` and `Output` sections: +In your main configuration file append the following: {% tabs %} -{% tab title="fluent-bit.conf" %} - -```python -[INPUT] - Name mem - Tag memory - -[OUTPUT] - Name stdout - Match * -``` - -{% endtab %} - {% tab title="fluent-bit.yaml" %} ```yaml @@ -61,10 +63,24 @@ pipeline: inputs: - name: mem tag: memory + outputs: - name: stdout match: '*' ``` {% endtab %} -{% endtabs %} +{% tab title="fluent-bit.conf" %} + +```text +[INPUT] + Name mem + Tag memory + +[OUTPUT] + Name stdout + Match * +``` + +{% endtab %} +{% endtabs %} \ No newline at end of file