Learn how to configure the rsyslog.conf file to forward the details in the Syslog server.
To forward mail logs to a Syslog server:
- Back up and then open /etc/rsyslog.conf using the vi command:
[root@imsva90 ~]# vi /etc/rsyslog.conf
- Locate the existing forwarding rule, and then append "mail.*" to the rule. For example,
if the original rule is:
# ### begin forwarding rule ### Local10.* @@192.168.61.106:514 # ### end of the forwarding rule ###
After appending mail.*:
# ### begin forwarding rule ### Local10.* @@192.168.61.106:514 mail.* @@192.168.61.106:514 # ### end of the forwarding rule ###
- Restart rsyslog service:
[root@imsva90 ~]# service rsyslog restart
- The new mail logs will be forwarded to the Syslog server. Take note that old mail logs will not be forwarded.