Wildcard support for InputFileName in rsyslog

log-filesloggingrsyslogsyslog

We have log files with names that match a certain pattern but frequently change. Is there a way to specify a wildcard or pattern for rsyslog to include via InputFileName?

Example:

InputFileName: /path/to/logs/*_error.log

Using the above example results in:

9351.070404487:7fd07e9be700: strm 0x7fd070004260: open error 2, file '/path/to/logs/*_error.log': No such file or directory

Is there a way to specify a pattern of files for rsyslog to include so that all log files that match a pattern will be included?

Best Answer

Ive done some research on this in the past. As of the last time i checked the imfile module doesn't support wildcards at all. Thought about possibly writing another input module but ended up just using syslog-ng on the hosts I need this functionality on.

Related Topic