fluentd
fluentd copied to clipboard
in_tail: Expand glob capability for square brackets and one character matcher
Which issue(s) this PR fixes: This PR will fix none of the issue but this was raised in community slack channel.
What this PR does / why we need it:
This feature was requested on the community slack's #fluentd channel. For now, we didn't support for square brackets pattern and one character matcher in #expand_paths.
This shouldn't be fit for the following case.
The logs are named as follows:
.
├── 01.log
├── 02.log
├── 03.log
├── 12.log
├── 13.log
├── 20.log
Then, a user wants to tail 02.log, 03.log, 12.log, and 13.log, and excluding to tail 01.log and 20.log with the following configuration:
<source>
@type tail
path "[0-1][2-3].log"
<parse>
@type none
</parse>
tag log.test
read_from_head
use_extended_glob # To use this expansion, users need to enable this feature explicitly.
</source>
However, the current Fluentd doesn't handle the "[0-1][2-3].log" pattern as glob. It just handles as normal file name. This shouldn't be effective for this use case.
It would be nice to handle this pattern on the in_tail plugin.
Docs Changes: https://github.com/fluent/fluentd-docs-gitbook/pull/488
Release Note: Same as title.