Basically, I want my logs to appear in the format /var/log/2014-03-01/192.168.3.2_SW0002
where 192.168.3.2_SW0002
is a file automatically generated by rsyslog.
$template routerLogFile,"/etc/logs/**2014-03-01**/%fromhost-ip%_%HOSTNAME%"
Currently I have a cron job set up to create a folder with name=current date everyday, except I am not sure how to use rsyslog to specify the intermediate folder before the automatically generated IP address and hostname.
$template routerLogFile,"/etc/logs/%timegenerated:::date-strftime(%Y-%m-%d)%/%fromhost-ip%_%HOSTNAME%"
I previously had this which created a new logfile for each message received. I can't figure out a way to get rsyslog to recognize the date folder.
Any ideas?