maxCardinality

Limits how many distinct values of key are counted.

This parameter applies to mmcount: Message counting module.

Name:

maxCardinality

Scope:

input

Type:

positive integer

Default:

10000

Required?:

no

Introduced:

8.2612.0

Description

Only used when key is set and value is not, that is, when mmcount keeps a separate counter for every observed value. Each distinct value occupies memory for the lifetime of the action, and the values usually come from message content. maxCardinality caps the number of counters an action keeps.

Once the limit is reached, values that already have a counter continue to be counted normally. A message carrying a value that has no counter yet is left unchanged: no counter is created and no mmcount property is added. The first time this happens, mmcount logs a warning naming the action’s appname and key. The warning is emitted only once per action instance.

Choose a limit that covers the expected set of values, for example the number of distinct error codes or hosts being tracked, with headroom. Raising it increases the memory an untrusted sender can make the action consume.

Input usage

action(type="mmcount" appName="glusterd" key="!gf_code" maxCardinality="500")

See also

See also mmcount: Message counting module.


Support: rsyslog Assistant | GitHub Discussions | GitHub Issues: rsyslog source project

Contributing: Source & docs: rsyslog source project

© 2008–2026 Rainer Gerhards and others. Licensed under the Apache License 2.0.