I am a newbie to Linux and rsyslog. I have used the logfiles for many years, but I have never had to set one up. At this point I have some Proof of Concept devices pointing to my Debain Linux server. I have the syslog messages coming in and being written to a single file: /var/log/prd/fwlog I am only concerned about 3 device types - switches, routers and firewalls. (all cisco) My rsyslog.conf is fairly simple, I have only modified the basic config, commented out the stuff I didn't like/need?
snipped out the comment out stuff.
$ModLoad immark # provides --MARK-- message capability
$ModLoad imudp
$UDPServerRun 514
$FileOwner root
$FileGroup adm
$FileCreateMode 0640
$DirCreateMode 0755
$Umask 0022
$WorkDirectory /var/spool/rsyslog
$IncludeConfig /etc/rsyslog.d/*.conf
*.* /var/log/prd/fwlog
Finally my questions!
I want to rotate and separate the routers and switches in a log with a date stamp called 'rslog-YYYY-MM-DD' also the firewalls into a log with a date stamp called 'fwlog-YYYY-MM-DD'
I want to compress(gzip?) the logs after 48hrs.
what do I need to add to my config?
I think I added the directory and file to my rsyslog in /etc/logrotate.d/rsyslog
/var/log/syslog
{
rotate 7
daily
missingok
notifempty
delaycompress
compress
postrotate
invoke-rc.d rsyslog rotate > /dev/null
endscript
}
/var/log/prd/fwlog*
/var/log/prd/rslog*
{
rotate 4
weekly
missingok
notifempty
compress
delaycompress
sharedscripts
postrotate
invoke-rc.d rsyslog rotate > /dev/null
endscript
}
Thanks in advance for any help!