Bug 1303617
Summary: | [RFE] wildcard filename support | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Rich Megginson <rmeggins> | ||||
Component: | rsyslog | Assignee: | Peter Vrabec <pvrabec> | ||||
Status: | CLOSED ERRATA | QA Contact: | Stefan Dordevic <sdordevi> | ||||
Severity: | unspecified | Docs Contact: | Mirek Jahoda <mjahoda> | ||||
Priority: | high | ||||||
Version: | 7.2 | CC: | bressers, ebarrera, jsantos, jvymazal, lmiksik, pvrabec, rsawhill, rsroka, santony, sdordevi, vanhoof | ||||
Target Milestone: | rc | Keywords: | FutureFeature, Patch | ||||
Target Release: | --- | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Enhancement | |||||
Doc Text: |
_rsyslog_ imfile module now supports a wildcard file name
The _rsyslog_ packages provide an enhanced, multi-threaded syslog daemon. With this update, the _rsyslog_ imfile module supports using wildcards inside file names and adding the actual file name to the message's metadata. This is useful, when _rsyslog_ needs to read logs under a directory and does not know the names of files in advance.
|
Story Points: | --- | ||||
Clone Of: | Environment: | ||||||
Last Closed: | 2016-11-04 05:37:23 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Bug Depends On: | |||||||
Bug Blocks: | 1203710, 1296594, 1313485 | ||||||
Attachments: |
|
Description
Rich Megginson
2016-02-01 13:11:36 UTC
After speaking with Tomas, it may be possible to backport this feature from rsyslog v8 to rsyslog v7 in RHEL 7.3. I am requesting acks for 7.3. Created attachment 1153459 [details]
Backport of wildcard support
This backport introduce some new features:
Module:
- option "mode" which can be polling|inotify and it's not required
- !BUT! there is difference between us and upstream
- we have as default option "polling" and upstream has "inotify"
- because we need to preserve backward compatibility
Input:
- new options: escapeLF, removestateondelete works as upstream
- new features: dynamic statefiles, wildcards(inotify mode)
- statefile is not required now, if it's not given then dynamic statefile is created
Refactoring of internal structures:
- active file table: from fixed array to double-linked list
- using listners as upstream
doc/imfile.html is updated as well.
This patch was derived from upstream commits:
ea9c81ce
7ca5b1e5
c9c6bd47
68ac87cb
25baf0e1
dcd19358
36f373be
d11858de
fd7ab1ee
f63d5ed4
e73b8413
7cf1349a
e53d6114
ef9fad05
e5e7836b
385fde74
0f164bf7
---------------------------------------------------------------------
And here's some test cases:
---
#default is polling mode so it's ok
module(load="imfile")
input(type="imfile" tag="tagggg1" file="/tmp/input_file")
input(type="imfile" tag="tagggg2" file="/tmp/input_data")
------------------------------------------------------------------
#default is polling so wildcards are not allowed
module(load="imfile")
input(type="imfile" tag="tagggg1" file="/tmp/input_*")
-----------------------------------------------------------------
#it's monitoring all matched files
module(load="imfile" mode="inotify")
input(type="imfile" tag="tagggg1" file="/tmp/input_*")
-----------------------------------------------------------------
#test of polling mode
module(load="imfile" mode="polling")
input(type="imfile" tag="tagggg1" file="/tmp/input_file")
input(type="imfile" tag="tagggg2" file="/tmp/input_data")
-----------------------------------------------------------------
#in polling mode wildcards are not allowed
module(load="imfile" mode="polling")
input(type="imfile" tag="tagggg1" file="/tmp/input_*")
-----------------------------------------------------------------
#statefile in inotify mode without wildcards is ok
module(load="imfile" mode="inotify")
input(type="imfile" tag="tagggg1" statefile="st1" file="/tmp/input_file")
input(type="imfile" tag="tagggg2" statefile="st2" file="/tmp/input_data")
-----------------------------------------------------------------
#statefile in polling mode is ok
module(load="imfile" mode="polling")
input(type="imfile" tag="tagggg1" statefile="st1" file="/tmp/input_file")
input(type="imfile" tag="tagggg2" statefile="st2" file="/tmp/input_data")
-----------------------------------------------------------------
#statefiles with wildcards are not allowed
module(load="imfile" mode="inotify")
input(type="imfile" tag="tagggg1" statefile="st1" file="/tmp/input_*")
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHEA-2016-2401.html |