summaryrefslogtreecommitdiffstats
path: root/source/configuration/modules/mmcount.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/configuration/modules/mmcount.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 '')
-rw-r--r--source/configuration/modules/mmcount.rst56
1 files changed, 56 insertions, 0 deletions
diff --git a/source/configuration/modules/mmcount.rst b/source/configuration/modules/mmcount.rst
new file mode 100644
index 0000000..de3247d
--- /dev/null
+++ b/source/configuration/modules/mmcount.rst
@@ -0,0 +1,56 @@
+*******
+mmcount
+*******
+
+=========================== ===========================================================================
+**Module Name:**  **mmcount**
+**Author:** Bala.FA <barumuga@redhat.com>
+**Available since:** 7.5.0
+=========================== ===========================================================================
+
+
+**Status:**\ Non project-supported module - contact author or rsyslog
+mailing list for questions
+
+
+Purpose
+=======
+
+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'.
+
+
+Examples
+========
+
+Example usage of the module in the configuration file.
+
+.. code-block:: none
+
+ module(load="mmcount")
+
+ # 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 {
+ $ActionMailSMTPServer smtp.example.com
+ $ActionMailFrom rsyslog@example.com
+ $ActionMailTo glusteradmin@example.com
+ $template mailSubject,"50th message of gf_code=9999 on %hostname%"
+ $template mailBody,"RSYSLOG Alert\r\nmsg='%msg%'"
+ $ActionMailSubject mailSubject
+ $ActionExecOnlyOnceEveryInterval 30
+ :ommail:;RSYSLOG_SyslogProtocol23Format
+ }
+
+