Rsyslog with variable input file name

apache-2.2rsyslog

I am running an apache server which is creating log files using rotatelogs.
It creates a new file every day with the date appended to it (e.g. filename.yyyy.mm.dd format).

I want to use rsyslog to transfer these logs to a common server but the problem is that variable $InputFileName of Module imFile requires the actual path and doesn't accept any variable or template name.

How do I provide a variable name to $InputFileName so that it automatically sends the log of the new file generated by rotatelogs everyday?

Best Answer

You could have Apache write to a file at a set path, have rsyslog read that file, and occasionally rotate that file using logrotate.