RSyslog Documentation


Module Name:mmcount
Author:Bala.FA <>
Available since:7.5.0

Status:Non project-supported module - contact author or rsyslog mailing list for questions


Message modification plugin which counts messages.

This module provides the capability to count log messages by severity or json property of given app-name. The count value is added into the log message as json property named ‘mmcount’.


Example usage of the module in the configuration file.


# count each severity of appname gluster
action(type="mmcount" appname="gluster")

# count each value of gf_code of appname gluster
action(type="mmcount" appname="glusterd" key="!gf_code")

# count value 9999 of gf_code of appname gluster
action(type="mmcount" appname="glusterfsd" key="!gf_code" value="9999")

# send email for every 50th mmcount
if $app-name == 'glusterfsd' and $!mmcount <> 0 and $!mmcount % 50 == 0 then {
   $template mailSubject,"50th message of gf_code=9999 on %hostname%"
   $template mailBody,"RSYSLOG Alert\r\nmsg='%msg%'"
   $ActionMailSubject mailSubject
   $ActionExecOnlyOnceEveryInterval 30

See also

Help with configuring/using Rsyslog:

  • Mailing list - best route for general questions
  • GitHub: rsyslog source project - detailed questions, reporting issues that are believed to be bugs with Rsyslog
  • Stack Exchange (View, Ask) - experimental support from rsyslog community

See also

Contributing to Rsyslog:

Copyright 2008-2020 Rainer Gerhards (Großrinderfeld), and Others.

Scroll to top