From a6b3b2d99fdc13b61f879ee88b43ed2eb531f158 Mon Sep 17 00:00:00 2001 From: Niko Wenselowski Date: Fri, 21 Feb 2025 12:11:58 +0100 Subject: [PATCH 1/2] input: tail: path: mention double asterisk globbing Previous versions required the use the tail_ex plugin, newer versions already have this included by default. Signed-off-by: Niko Wenselowski --- input/tail.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/input/tail.md b/input/tail.md index 743f8d60..0ea15ea0 100644 --- a/input/tail.md +++ b/input/tail.md @@ -95,6 +95,12 @@ path /path/to/a/*,/path/to/b/c.log If the date is `20140401`, Fluentd starts to watch the files in `/path/to/2014/04/01` directory. See also `read_from_head` parameter. +Using `**` for path globbing is supported. + +```text +path /path/to/**/some.log +``` + By default, You should not use `*` with log rotation because it may cause the log duplication. To avoid log duplication, you need to set `follow_inodes true` in the configuration. If you want to use other glob patterns such as `[]` and `?`, you need to set up `glob_policy extended` as described in the `glob_policy` section. From 9d40ffdc083c80d8e3def87a530c11707f36b7db Mon Sep 17 00:00:00 2001 From: Niko Wenselowski Date: Fri, 21 Feb 2025 12:12:15 +0100 Subject: [PATCH 2/2] Remove extra whitespace Signed-off-by: Niko Wenselowski --- input/tail.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/input/tail.md b/input/tail.md index 0ea15ea0..ddf27898 100644 --- a/input/tail.md +++ b/input/tail.md @@ -429,7 +429,7 @@ Refer to the [Logging](../deployment/logging.md) for more details. The `in_tail` plugin can assign each log file to a group, based on user defined rules. The `limit` parameter controls the total number of lines collected for a group within a `rate_period` time interval. -Example: +Example: ```text # group rules -- 1 @@ -462,9 +462,9 @@ Example: | :--- | :--- | :--- | | regexp | `/^\/var\/log\/containers\/(?[a-z0-9]([-a-z0-9]*[a-z0-9])?(\/[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)_(?[^_]+)_(?.+)-(?[a-z0-9]{64})\.log$/`| 1.15 | -Specifies the regular expression for extracting metadata (namespace, podname) from log file path. Default value of the pattern regexp extracts information about `namespace`, `podname`, `docker_id`, `container` of the log (K8s specific). +Specifies the regular expression for extracting metadata (namespace, podname) from log file path. Default value of the pattern regexp extracts information about `namespace`, `podname`, `docker_id`, `container` of the log (K8s specific). -You can also add custom named captures in `pattern` for custom grouping of log files. For example, +You can also add custom named captures in `pattern` for custom grouping of log files. For example, ```text pattern /^\/home\/logs\/(?.+)\.log$/ ``` @@ -565,7 +565,7 @@ path C:\\path\\to\\*\\foo.log If this article is incorrect or outdated, or omits critical information, please [let us know](https://github.com/fluent/fluentd-docs-gitbook/issues?state=open). [Fluentd](http://www.fluentd.org/) is an open-source project under [Cloud Native Computing Foundation \(CNCF\)](https://cncf.io/). All components are available under the Apache 2 License. -### What happens when a file can be assigned to more than one group? +### What happens when a file can be assigned to more than one group? Example, @@ -573,7 +573,7 @@ Example, ## Rule1 match { namespace: /monitoring/ - } + } limit 100