Skip to content

Admin: config: classic: scema: Update for style #1665

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from 1 commit
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
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
# Formats and Schema
# Formats and schema

Fluent Bit might optionally use a configuration file to define how the service will behave.

Before proceeding we need to understand how the configuration schema works.

The schema is defined by three concepts:

* Sections
* Entries: Key/Value
* Indented Configuration Mode
- Sections
- Entries: Key/Value
- Indented Configuration Mode

A simple example of a configuration file is as follows:
An example of a configuration file is as follows:

```python
[SERVICE]
Expand All @@ -19,30 +17,31 @@ A simple example of a configuration file is as follows:
log_level debug
```

## Sections <a id="sections"></a>
## Sections

A section is defined by a name or title inside brackets. Looking at the example above, a Service section has been set using **\[SERVICE\]** definition. Section rules:
A section is defined by a name or title inside brackets. Using the previous example,
a Service section has been set using `[SERVICE]` definition. The following rules apply:

* All section content must be indented \(4 spaces ideally\).
* Multiple sections can exist on the same file.
* A section is expected to have comments and entries, it cannot be empty.
* Any commented line under a section, must be indented too.
* End-of-line comments are not supported, only full-line comments.
- All section content must be indented (4 spaces ideally).
- Multiple sections can exist on the same file.
- A section must have comments and entries.
- Any commented line under a section must be indented too.
- End-of-line comments aren't supported, only full-line comments.

## Entries: Key/Value <a id="entries_kv"></a>
## Entries: Key/Value

A section may contain **Entries**, an entry is defined by a line of text that contains a **Key** and a **Value**, using the above example, the `[SERVICE]` section contains two entries, one is the key **Daemon** with value **off** and the other is the key **Log\_Level** with the value **debug**. Entries rules:
A section can contain entries. An entry is defined by a line of text that contains a `Key` and a `Value`. Using the previous example, the `[SERVICE]` section contains two entries: one is the key `Daemon` with value `off` and the other is the key `Log_Level` with the value `debug`. The following rules apply:

* An entry is defined by a key and a value.
* A key must be indented.
* A key must contain a value which ends in the breakline.
* Multiple keys with the same name can exist.
- An entry is defined by a key and a value.
- A key must be indented.
- A key must contain a value which ends in the breakline.
- Multiple keys with the same name can exist.

Also commented lines are set prefixing the **\#** character, those lines are not processed but they must be indented too.
Commented lines are set prefixing the `#` character. Commented lines aren't processed but they must be indented.

## Indented Configuration Mode <a id="indented_mode"></a>
## Indented configuration mode

Fluent Bit configuration files are based in a strict **Indented Mode**, that means that each configuration file must follow the same pattern of alignment from left to right when writing text. By default an indentation level of four spaces from left to right is suggested. Example:
Fluent Bit configuration files are based in a strict indented mode. Each configuration file must follow the same pattern of alignment from left to right when writing text. By default, an indentation level of four spaces from left to right is suggested. Example:

```python
[FIRST_SECTION]
Expand All @@ -55,5 +54,5 @@ Fluent Bit configuration files are based in a strict **Indented Mode**, that mea
KeyN 3.14
```

As you can see there are two sections with multiple entries and comments, note also that empty lines are allowed and they do not need to be indented.

This example shows two sections with multiple entries and comments. Empty lines are
allowed.