Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions configuration/config-file-yaml.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Normal Fluentd configuration syntax has the following the list of directives:
4. **`system`** directives set system-wide configuration
5. **`label`** directives group the output and filter for internal routing
6. **`worker`** directives limit to the specific workers
7. **`@include`** directives include other files
7. **`!include`** directives include other files

In YAML configuration world, we reconstructed them for YAML format.

Expand All @@ -49,7 +49,8 @@ Under `config` object, Fluentd will handle the following elements:
6. **`$arg`** defines directive **arg**'s equivalent objects (e.g. \<DIRECTIVE **arg**\>)
7. **`$name`** defines label directive **name** equivalent objects (e.g. \<label **name**\>)
8. **`$type`** specifies `@type` or `type` for instantiating plugin type
9. **`$log_level`** specifies `@log_level` per plugin
9. **`$id`** specifies plugin id
10. **`$log_level`** specifies `@log_level` per plugin

NOTE: `$log_level` is supported since Fluentd v1.17.1 or v1.16.6. If you want to change log_level per plugin on 1.17.0/v1.16.5 or older versions, you can use `log_level` (without `$`) although it is deprecated.

Expand Down Expand Up @@ -312,41 +313,41 @@ The element in separate configuration files can be imported using the **!include
```yaml
config:
# Include config files in the ./config.d directory
- !include config.d/*.conf
- !include config.d/*.yaml
```

The `!include` YAML tag supports regular file path, glob pattern, and http URL conventions:

```yaml
config:
# absolute path
- !include /path/to/config.conf
- !include /path/to/config.yaml

# if using a relative path, the YAML tag will use
# the dirname of this config file to expand the path
- !include extra.conf
- !include extra.yaml

# glob match pattern
- !include config.d/*.conf
- !include config.d/*.yaml

# http
- !include http://example.com/fluent.conf
- !include http://example.com/fluent.yaml
```


Note that for the glob pattern, files are expanded in alphabetical order. If there are `a.conf` and `b.conf` then fluentd parses `a.conf` first. But, you should not write the configuration that depends on this order. It is so error-prone, therefore, use multiple separate `!include` YAML tags for safety.
Note that for the glob pattern, files are expanded in alphabetical order. If there are `a.yaml` and `b.yaml` then fluentd parses `a.yaml` first. But, you should not write the configuration that depends on this order. It is so error-prone, therefore, use multiple separate `!include` YAML tags for safety.

```yaml
config:
# If you have a.conf, b.conf, ..., z.conf and a.conf / z.conf are important
# If you have a.yaml, b.yaml, ..., z.yaml and a.yaml / z.yaml are important

# This is bad
- !include *.conf
- !include *.yaml

# This is good
- !include a.conf
- !include config.d/*.conf
- !include z.conf
- !include a.yaml
- !include config.d/*.yaml
- !include z.yaml
```

### Share the Same Parameters
Expand Down