Skip to content

Commit 781302c

Browse files
committed
configuration: add section tips for YAML format
Signed-off-by: Daijiro Fukuda <[email protected]>
1 parent 341500c commit 781302c

File tree

1 file changed

+63
-17
lines changed

1 file changed

+63
-17
lines changed

configuration/config-file-yaml.md

Lines changed: 63 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,69 @@ $ fluentd --dry-run -c fluent.yaml
465465

466466
This section describes some useful features for the configuration file.
467467

468+
### Section
469+
470+
Points:
471+
472+
* You can configure a section by using its name as the key.
473+
* You can configure multiple sections by using Array as the value.
474+
475+
Here are examples.
476+
477+
Parse Section:
478+
479+
```yaml
480+
config:
481+
- source:
482+
$type: tail
483+
tag: sample
484+
path: /tmp/test.log
485+
pos_file: /tmp/tail-test.pos
486+
parse:
487+
$type: none
488+
```
489+
490+
Buffer Section:
491+
492+
```yaml
493+
config:
494+
- match:
495+
$type: stdout
496+
$tag: test.**
497+
buffer:
498+
$arg: tag, time
499+
$type: memory
500+
```
501+
502+
Inject/Format Section:
503+
504+
```yaml
505+
config:
506+
- match:
507+
$type: stdout
508+
$tag: test.**
509+
inject:
510+
time_key: timestamp
511+
time_type: string
512+
format:
513+
$type: csv
514+
fields: timestamp, message
515+
```
516+
517+
Multiple Section:
518+
519+
```yaml
520+
config:
521+
- match:
522+
$type: copy
523+
$tag: test.**
524+
store:
525+
- $type: relabel
526+
$label: "@foo"
527+
- $type: relabel
528+
$label: "@bar"
529+
```
530+
468531
### Multiline support for " quoted string, array and hash values
469532

470533
You can write multiline values for `"` quoted string, array and hash values.
@@ -552,21 +615,4 @@ The backslash `\` is interpreted as an escape character. You need `\` for settin
552615
str_param: "foo\nbar" # \n is interpreted as actual LF character
553616
```
554617

555-
### Parse setting
556-
557-
You can use `parse:` to set up the parser for the input plugin.
558-
559-
Example: in_tail plugin
560-
561-
```yaml
562-
config:
563-
- source:
564-
$type: tail
565-
tag: sample
566-
path: /tmp/test.log
567-
pos_file: /tmp/tail-test.pos
568-
parse:
569-
$type: none
570-
```
571-
572618
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.

0 commit comments

Comments
 (0)