I see this in the `systemctl status rsyslog` output: Jul 23 06:47:54 dev-coprbe.devel.redhat.com rsyslogd[2537572]: error during parsing file /etc/rsyslog.d/01-remote.conf, on or before line 13: omfile: default template already set via module global parameter - can no longer be changed [v8.2010.0 try https://www.rsyslog.com/e/2207 ] This seems to be coming from: https://github.com/rsyslog/rsyslog/blob/master/tools/omfile.c#L355 What I need: rsyslog started without errors
This package has changed maintainer in Fedora. Reassigning to the new maintainer of this component.
Attila, tihs is IMO problem of /etc/rsyslog.conf, line 13: -module(load="builtin:omfile" Template="RSYSLOG_TraditionalFileFormat") +module(load="builtin:omfile") This is though in the default rsyslog.conf file (shipped with the package).
Hi Pavel (In reply to Pavel Raiskup from comment #3) > Attila, tihs is IMO problem of /etc/rsyslog.conf, line 13: > > -module(load="builtin:omfile" Template="RSYSLOG_TraditionalFileFormat") > +module(load="builtin:omfile") I am not sure if this solves your issue, because by default "RSYSLOG_TraditionalFileFormat" is used when the Template is not specified, thus parsing /etc/rsyslog.d/01-remote.conf will signal a warning message. The reason why I would not remove module(load="builtin:omfile" Template="RSYSLOG_TraditionalFileFormat") from the main config file is the following: Let's assume you have multiple config files inside /etc/rsyslog.d/ directory, some of them might use omfile actions, so in that case users should always put the module(load=...) to the first config file(by alphabetical order). > > This is though in the default rsyslog.conf file (shipped with the package).
Ah, OK, your explanation makes sense I think. The contents of the 01-remote.conf file is then: 1 # 2 # Ansible managed 3 # 4 5 # This is basically the RSYSLOG_SyslogProtocol23Format, which is RFC 5424 on 6 # the wire, but with the message payload a CEE/Lumberjack JSON document. 7 template(name="BITSCOUT_SyslogProtocol23Format" type="string" 8 string="<%PRI%>1 %TIMESTAMP:::date-rfc3339% %HOSTNAME% %APP-NAME% %PROCID% %MSGID% %STRUCTURED-DATA% @cee:%$!%\n") 9 10 set $!msg = $msg; 11 12 # Use updated timestamp format for local files 13 $ActionFileDefaultTemplate RSYSLOG_FileFormat 14 15 $ActionQueueFileName remote # unique name prefix for spool files 16 $ActionQueueMaxDiskSpace 1g # 1gb space limit (use as much as possible) 17 $ActionQueueSaveOnShutdown on # save messages to disk on shutdown 18 $ActionQueueType LinkedList # run asynchronously 19 $ActionResumeRetryCount -1 # infinite retries if host is down 20 21 22 *.* @@10.0.12.155:514;BITSCOUT_SyslogProtocol23Format So the complaining line is `$ActionFileDefaultTemplate RSYSLOG_FileFormat`. Is Is it incorrect to do this, then?
The problem is that the omfile module has been loaded with the default Template in your main configuration file and you are trying to rewrite the default template via $ActionFileDefaultTemplate(you can set it only once). You might want to consider setting the default template to whatever you want in /etc/rsyslog.conf and remove $ActionFileDefaultTemplate RSYSLOG_FileFormat from 01-remote.conf. Anyway, in this file you are using BITSCOUT_SyslogProtocol23Format template for omfile actions instead of the default, so I think it's okay to just remove line 13.
> The problem is that the omfile module has been loaded with the default Template in your main configuration file and you are trying to rewrite the default template via Yes. But the default config file is installed by the package, I haven't configured the default template myself. The intention is to just install stuff into /etc/rsyslog.d/ and keep /etc/rsyslog.conf as-is (in package-maintainer format). That's why I reported this issue; I would prefer if the template was *not* set in /etc/rsyslog.conf, because it is now the only reason why we have to ansible-configure /etc/rsyslog.conf.
Now I see your point here. Note that if we remove the Template="RSYSLOG_TraditionalFileFormat" when loading omfile module, the default will be still RSYSLOG_TraditionalFileFormat, which should be set internally.
FEDORA-2021-fd229188eb has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2021-fd229188eb
FEDORA-2021-fd229188eb has been pushed to the Fedora 36 stable repository. If problem still persists, please make note of it in this bug report.
Thank you!
(In reply to Attila Lakatos from comment #9) > Now I see your point here. Note that if we remove the > Template="RSYSLOG_TraditionalFileFormat" when loading omfile module, the > default will be still RSYSLOG_TraditionalFileFormat, which should be set > internally. I'm afraid this is not the case. With this modification, the log format changed to "2022-05-14T18:36:35.541849+02:00 <hostname> ..." instead of "May 14 19:19:07 <hostname> ..."