File: rs-dyn_inc.rst

package info (click to toggle)
rsyslog-doc 8.2504.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 4,556 kB
  • sloc: python: 178; makefile: 8
file content (35 lines) | stat: -rw-r--r-- 924 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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)