log with the template RSYSLOG_DebugFormat so you can see what's in each variable. I think that will answer your question (I don't think it's what you think it is)

David Lang

 On Mon, 18 Jan 2021, Alex via rsyslog wrote:

Date: Mon, 18 Jan 2021 21:52:28 -0500
From: Alex via rsyslog <[email protected]>
To: [email protected]
Cc: Alex <[email protected]>
Subject: [rsyslog] logging remote clients based on facility

Hi,

I'm using rsyslog-8.2010.0 on fedora33 as a remote logging server. I'd
like to consider logging mail.* messages to individual files based on
hostname. Primarily I want mail messages from the log server (xavier)
to go in the regular /var/log/maillog file.

This is what I've come up with so far, but it doesn't appear to do
anything. It also doesn't report any errors when I reload rsyslog.
What am I doing wrong?

if $hostname == 'xavier' then {
  if $facility == 2 then action(type="omfile" file="/var/log/maillog")
  if $facility != 2 then action(type="omfile" file="/var/log/maillog-other")
}

I've seen references to $syslogfacility instead of just $facility in
the documentation, but that doesn't appear to make a difference
either.

Thanks,
Alex
_______________________________________________
rsyslog mailing list
https://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of 
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE 
THAT.

_______________________________________________
rsyslog mailing list
https://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of 
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE 
THAT.

Reply via email to