You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: input/tail.md
+96Lines changed: 96 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -402,6 +402,80 @@ The `@log_level` option allows the user to set different levels of logging for e
402
402
403
403
Refer to the [Logging](../deployment/logging.md) for more details.
404
404
405
+
406
+
### `<group>` Section
407
+
408
+
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.
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).
444
+
445
+
You can also add custom named captures in `pattern` for custom grouping of log files. For example,
446
+
```text
447
+
pattern /^\/home\/logs\/(?<file>.+)\.log$/
448
+
```
449
+
In this example, filename will be extracted and used to form groups.
450
+
451
+
#### `rate_period`
452
+
453
+
| type | default | version |
454
+
| :--- | :--- | :--- |
455
+
| time | 60 \(seconds\)| 1.15 |
456
+
457
+
Time period in which the group line limit is applied. `in_tail` resets the counter after every `rate_period` interval.
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.
471
545
546
+
### What happens when a file can be assigned to more than one group?
547
+
548
+
Example,
549
+
550
+
```text
551
+
<rule> ## Rule1
552
+
match {
553
+
namespace: /monitoring/
554
+
}
555
+
limit 100
556
+
</rule>
557
+
558
+
<rule> ## Rule2
559
+
match {
560
+
namespace: /monitoring/,
561
+
podname: /logger/,
562
+
}
563
+
limit 2000
564
+
</rule>
565
+
```
566
+
567
+
In this case, rules with more constraints, i.e., greater number of `match` hash keys will be given a higher priority. So a file will be assigned to `Rule2` if it can be assigned to both `Rule1` and `Rule2`.
0 commit comments