rsyslog cannot load the same module with multiple times

Solution Verified - Updated -

Issue

  • rsyslog is configured to load imjournal module in /etc/rsyslog.conf and /etc/rsyslog.d/test.conf files.
# cat /etc/rsyslog.conf
...
module(load="imjournal"         # provides access to the systemd journal
       StateFile="imjournal.state") # File to store the position in the journal
...

# cat /etc/rsyslog.d/test.conf
module(load="imjournal" ratelimit.interval="300" ratelimit.burst="30000")
  • rsyslogd get errors in checking configuration.
# rsyslogd -N1
rsyslogd: version 8.2102.0-7.el8_6.1, config validation run (level 1), master config /etc/rsyslog.conf
rsyslogd: module 'imjournal' already in this config, cannot be added  [v8.2102.0-7.el8_6.1 try https://www.rsyslog.com/e/2221 ]
rsyslogd: error during parsing file /etc/rsyslog.d/test.conf, on or before line 1: parameter 'ratelimit.burst' not known -- typo in config file? [v8.2102.0-7.el8_6.1 try https://www.rsyslog.com/e/2207 ]
rsyslogd: error during parsing file /etc/rsyslog.d/test.conf, on or before line 1: parameter 'ratelimit.interval' not known -- typo in config file? [v8.2102.0-7.el8_6.1 try https://www.rsyslog.com/e/2207 ]
  • rsyslog daemon can run but the configuration in /etc/rsyslog.d/test.conf is not effective.
# systemctl status rsyslog
* rsyslog.service - System Logging Service
   Loaded: loaded (/usr/lib/systemd/system/rsyslog.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2022-10-20 10:48:24 CST; 2min 45s ago
     Docs: man:rsyslogd(8)
           https://www.rsyslog.com/doc/
 Main PID: 56570 (rsyslogd)
    Tasks: 9 (limit: 11048)
   Memory: 52.4M
   CGroup: /system.slice/rsyslog.service
           `-56570 /usr/sbin/rsyslogd -n

Oct 20 10:48:24 rhel8.example.com systemd[1]: Starting System Logging Service...
Oct 20 10:48:24 rhel8.example.com rsyslogd[56570]: warning: ~ action is deprecated, consider using the 'stop' statement instead [v8.2102.0-7.el8_6.1 try https://www.rsyslog.com/e/2307 ]
Oct 20 10:48:24 rhel8.example.com systemd[1]: Started System Logging Service.
Oct 20 10:48:24 rhel8.example.com rsyslogd[56570]: module 'imjournal' already in this config, cannot be added  [v8.2102.0-7.el8_6.1 try https://www.rsyslog.com/e/2221 ]
Oct 20 10:48:24 rhel8.example.com rsyslogd[56570]: error during parsing file /etc/rsyslog.d/test.conf, on or before line 1: parameter 'ratelimit.burst' not known -- typo in config file? [v8.2102.0-7.el8_6.1 try https://www.rsyslog.com/e/2207 ]
Oct 20 10:48:24 rhel8.example.com rsyslogd[56570]: error during parsing file /etc/rsyslog.d/test.conf, on or before line 1: parameter 'ratelimit.interval' not known -- typo in config file? [v8.2102.0-7.el8_6.1 try https://www.rsyslog.com/e/2207 ]
Oct 20 10:48:24 rhel8.example.com rsyslogd[56570]: [origin software="rsyslogd" swVersion="8.2102.0-7.el8_6.1" x-pid="56570" x-info="https://www.rsyslog.com"] start
Oct 20 10:48:25 rhel8.example.com rsyslogd[56570]: imjournal: journal files changed, reloading...  [v8.2102.0-7.el8_6.1 try https://www.rsyslog.com/e/0 ]

Environment

  • Red Hat Enterprise Linux 8
  • Red Hat Enterprise Linux 9
  • rsyslog

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content