key

Names the JSON property whose values are counted on matching messages.

This parameter applies to mmcount.

Name:

key

Scope:

input

Type:

word

Default:

none (count messages per severity)

Required?:

no

Introduced:

7.5.0

Description

Directs mmcount to evaluate a structured property on each message that matches appName. The value should be the RainerScript variable name used to access the JSON property (e.g., !gf_code).

If the named property is absent, mmcount leaves the message unchanged and no counter is modified. When the property exists, its value is converted into a string (JSON null becomes an empty string) and used to select which counter to increment. Without value, mmcount creates a distinct counter for every observed value and writes the running total for that value into the message’s mmcount property.

Input usage

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

See also

See also mmcount.


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

Contributing: Source & docs: rsyslog source project

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