Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm new to rsyslog and have been trying to figure out why I am not receiving any of my Apache and mysql logs which are configured on the client-side to sent via rsyslog. I am currently receiving all other types of logs from all my hosts except Apache and mysql. I am assuming something is wrong with my filter directive on the server side. Below is a copy of the directives I configured for mysql and apache.

$template PerHostApacheError,"/syslog/%$YEAR%/%$MONTH%/%$DAY%/%HOSTNAME%/error.log"
$template PerHostApacheAccess,"/syslog/%$YEAR%/%$MONTH%/%$DAY%/%HOSTNAME%/%msg:R,ERE,1,ZERO:imp:([a-zA-Z0-9\-]+)\.--end%-access.log"
$template PerHostMySqld,"/syslog/%$YEAR%/%$MONTH%/%$DAY%/%HOSTNAME%/mysql.log"

My question is do the above directives on the server side look correct? If not, how are they supposed to look like. The documentation doesn't really show examples of how it should be used, but more of what each one does. Also, is there an option to catch all messages that don't have a directive defined - for example log all other messages not defined via a directive to a catchall.log file on a per host basis. Something like:

$template PerHostCatchAll,"/syslog/%$YEAR%/%$MONTH%/%$DAY%/%HOSTNAME%/catchall.log

Thanks for the help in advance.

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.