Wildcard support for InputFileName in rsyslog?

11,696

Solution 1

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.

Solution 2

As an update to this post rsyslog 8.5 (currently development but soon to be stable) does support wildcards, I've tested this and can confirm it is working.

Share:
11,696

Related videos on Youtube

Dan
Author by

Dan

Updated on September 18, 2022

Comments

  • Dan
    Dan almost 2 years

    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?

  • AXE Labs
    AXE Labs almost 10 years
    It seems the free version of syslog-ng does not support wildcards... There is this work around: asylum.madhouse-project.org/blog/2013/09/10/…
  • squillman
    squillman over 9 years
    Welcome to Server Fault! We generally discourage link-only answers since links break over time. It would be beneficial to add relevant snippets to your answer so this doesn't become obsolete if/when the link breaks.