summaryrefslogtreecommitdiffstats
path: root/source/rainerscript/functions/rs-dyn_inc.rst
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 16:27:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 16:27:18 +0000
commitf7f20c3f5e0be02585741f5f54d198689ccd7866 (patch)
tree190d5e080f6cbcc40560b0ceaccfd883cb3faa01 /source/rainerscript/functions/rs-dyn_inc.rst
parentInitial commit. (diff)
downloadrsyslog-doc-f7f20c3f5e0be02585741f5f54d198689ccd7866.tar.xz
rsyslog-doc-f7f20c3f5e0be02585741f5f54d198689ccd7866.zip
Adding upstream version 8.2402.0+dfsg.upstream/8.2402.0+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'source/rainerscript/functions/rs-dyn_inc.rst')
-rw-r--r--source/rainerscript/functions/rs-dyn_inc.rst35
1 files changed, 35 insertions, 0 deletions
diff --git a/source/rainerscript/functions/rs-dyn_inc.rst b/source/rainerscript/functions/rs-dyn_inc.rst
new file mode 100644
index 0000000..67769cc
--- /dev/null
+++ b/source/rainerscript/functions/rs-dyn_inc.rst
@@ -0,0 +1,35 @@
+*********
+dyn_inc()
+*********
+
+Purpose
+=======
+
+dyn_inc(bucket_name_literal_string, str)
+
+Increments counter identified by ``str`` in dyn-stats bucket identified
+by ``bucket_name_literal_string``. Returns 0 when increment is successful,
+any other return value indicates increment failed.
+
+Counters updated here are reported by **impstats**.
+
+Except for special circumstances (such as memory allocation failing etc),
+increment may fail due to metric-name cardinality being under-estimated.
+Bucket is configured to support a maximum cardinality (to prevent abuse)
+and it rejects increment-operation if it encounters a new(previously unseen)
+metric-name(``str``) when full.
+
+**Read more about it here** :doc:`Dynamic Stats<../../configuration/dyn_stats>`
+
+
+Example
+=======
+
+The following example shows the counter $hostname incremented in the bucket
+msg_per_host.
+
+.. code-block:: none
+
+ dyn_inc("msg_per_host", $hostname)
+
+