:fromhost-ip,isequal,"192.168.1.1" /var/log/remote.log
:fromhost-ip,isequal,"192.168.1.2" /var/log/remote.log
:fromhost-ip,isequal,"192.168.1.3" /var/log/remote.log
........
*.info;mail.none;authpriv.none;cron.none /var/log/messages
192.168.1.1~3的log會寫入到/var/log/remote.log,但同時也會寫入
到/var/log/messages!
解決方法:
& ~
:fromhost-ip,isequal,"192.168.1.1" /var/log/remote.log
:fromhost-ip,isequal,"192.168.1.2" /var/log/remote.log& ~
:fromhost-ip,isequal,"192.168.1.3" /var/log/remote.log& ~
........
*.info;mail.none;authpriv.none;cron.none /var/log/messages
"& ~"能通知rsyslog,當把remote device log寫入到/var/log/remote.log後,就停止接下來的動作,那麼當然remote device log就不會寫入到/var/log/messages囉!