2

The documentation for the "mmsequence" plugin for rsyslog 8.16.0 says:

This module is deprecated in v8 and solely provided for backward compatibility reasons. It was written as a work-around for missing global variable support in v7. Global variables are available in v8, and at some point in time this module will entirely be removed.

Do not use this module for newly crafted config files. Use global variables instead.

However, I see no reference to global variables in the rsyslogd v8 help documentation either as shipped with the package, nor the online version.

Please, how do I use a global variable in the modern expression-based format for rsyslogd v8?

the.jxc
  • 173
  • 1
  • 1
  • 7

1 Answers1

1

And... I finally found the answer buried in a blog post. It seems that global variables are prefixed with $/ in rsyslog v8 configuration.

set $/myvar = 1;

the.jxc
  • 173
  • 1
  • 1
  • 7
  • Can you post a link to the blog post you are referring to? – Ziffusion Sep 06 '18 at 15:23
  • 1
    Not sure if this was the original, but here's the blog post defining the proposal: https://rainer.gerhards.net/2013/10/a-proposal-for-rsyslog-state-variables.html – the.jxc Sep 10 '18 at 05:52
  • 1
    So how do you implement `mmsequence` (e.g. to have a global message counter) using global variables? – OrangeDog Apr 02 '19 at 10:51