Rsyslog Configuration Issue with '& ~'

by Joe   Last Updated August 14, 2019 20:00 PM

I am trying to configure a rsyslog server which will collect logs from remote hosts. I have been able to get this working however, the server is also send local logs to the log file where I wish the remote logs to be logged.

After looking at the docs I see that they use the & ~ after the statements defining the remote logging settings. This according to the docs should prevent local logs from being written to my remote log file.

When I put that line in though, it breaks the service. I receive this error:

rsyslogd: version 8.24.0-34.el7, config validation run (level 1), master config /etc/rsyslog.conf
rsyslogd: error during parsing file /etc/rsyslog.conf, on or before line 26: syntax error on token '&' [v8.24.0-34.el7 try ]
rsyslogd: CONFIG ERROR: could not interpret master config file '/etc/rsyslog.conf'. [v8.24.0-34.el7 try ]

Here is the relevant section of my config file:

$template RemoteLogs,"/var/log/LOGTEST/test.log"
*.* ?RemoteLogs

& ~

Is there something simple that I am missing??? Thanks!

Related Questions

Unable to log into a rsyslog filter using logger

Updated August 31, 2015 21:00 PM

Rsyslog Remote Logging: Garbled Text when using TLS

Updated October 22, 2018 09:00 AM

No local logs after setting remote host in rsyslog

Updated August 30, 2017 13:00 PM

rsyslog send directory to remote host

Updated November 29, 2017 10:00 AM

How to use capture group in rsyslog?

Updated November 03, 2017 07:00 AM