How do I modify /etc/syslog.conf so that I would send all messages with "warn" priority, except those of type "mail" and "lpr" to /var/log/mywarnings. I also have to send all messages of type "mail", except those with priority "err" to /var/log/mymail.
1 Answer
man rsyslog.conf
will go a long way.
But to get you started:
*.=warn;mail.none;lpr.none /var/log/mywarnings
This basically says all messages equal to level warn (*.warn
would be warning or higher), but then exclude mail and lpr by asking for .none
, to go to /var/log/mywarnings
.
To exclude a priority and higher, use !
. To exclude just one, it's !=
. So:
mail.*;mail.!=err /var/log/mymail