Skip to content

Commit dc0465e

Browse files
consolidate multiline parsers info (#2279)
* consolidate multiline parsers info Signed-off-by: Alexa Kreizinger <alexakreizinger@gmail.com> * Apply suggestions from code review Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Alexa Kreizinger <alexakreizinger@gmail.com> * fix bad links Signed-off-by: Alexa Kreizinger <alexakreizinger@gmail.com> * remove bad info from contributing file Signed-off-by: Alexa Kreizinger <alexakreizinger@gmail.com> * Update administration/configuring-fluent-bit/yaml/multiline-parsers-section.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Alexa Kreizinger <alexakreizinger@gmail.com> * remove typo Signed-off-by: Alexa Kreizinger <alexakreizinger@gmail.com> * Apply suggestions from code review Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Alexa Kreizinger <alexakreizinger@gmail.com> --------- Signed-off-by: Alexa Kreizinger <alexakreizinger@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent f9803d3 commit dc0465e

File tree

11 files changed

+52
-46
lines changed

11 files changed

+52
-46
lines changed

.gitbook.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,4 @@ redirects:
102102
installation/downloads/amazon-ec2: ./installation/downloads/linux/amazon-linux.md
103103
administration/configuring-fluent-bit/yaml/configuration-file: ./administration/configuring-fluent-bit/yaml.md
104104
administration/configuring-fluent-bit/unit-sizes: ./administration/configuring-fluent-bit.md#unit-sizes
105+
administration/configuring-fluent-bit/multiline-parsing: ./pipeline/parsers/multiline-parsing.md

CONTRIBUTING.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Before you contribute to the Fluent Bit docs, review these critical tips:
1515

1616
- [Sign off](#sign-off-your-git-commits) your Git commits.
1717
- Use [soft line wraps](#line-wraps) in Markdown files.
18-
- To link between pages, use [absolute file paths](#links).
1918
- Review the results of [linters](#linters) for style and formatting guidance.
2019

2120
## Review process
@@ -69,14 +68,6 @@ The active [linters](#linters) in this repository flag certain style errors and,
6968

7069
The Fluent Bit docs library is built and hosted through [GitBook](https://docs.gitbook.com/). Unfortunately, GitBook doesn't support local previews for contributors, but a Fluent Bit maintainer with a dedicated GitBook account can verify that things are formatted correctly after you open a new pull request.
7170

72-
### Links
73-
74-
When cross-linking between in this repository, use a full absolute path whenever possible. For example:
75-
76-
```text
77-
[LTSV](../pipeline/parsers/ltsv.md) and [Logfmt](../pipeline/parsers/logfmt.md)
78-
```
79-
8071
### Line wraps
8172

8273
When GitBook renders pages, it treats all newlines literally, which means hard line wraps in Markdown files create awkward line breaks in the Fluent Bit docs site. Due to this, docs contributions must use soft line wraps.

SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
* [Record accessor syntax](administration/configuring-fluent-bit/classic-mode/record-accessor.md)
5555
* [Upstream servers](administration/configuring-fluent-bit/classic-mode/upstream-servers.md)
5656
* [Variables](administration/configuring-fluent-bit/classic-mode/variables.md)
57-
* [Multiline parsing](administration/configuring-fluent-bit/multiline-parsing.md)
5857
* [AWS credentials](administration/aws-credentials.md)
5958
* [Backpressure](administration/backpressure.md)
6059
* [Buffering and storage](administration/buffering-and-storage.md)
@@ -126,6 +125,7 @@
126125
* [Windows System Statistics (winstat)](pipeline/inputs/windows-system-statistics.md)
127126
* [Parsers](pipeline/parsers.md)
128127
* [Configuring custom parsers](pipeline/parsers/configuring-parser.md)
128+
* [Multiline parsing](pipeline/parsers/multiline-parsing.md)
129129
* [JSON format](pipeline/parsers/json.md)
130130
* [Logfmt format](pipeline/parsers/logfmt.md)
131131
* [LTSV format](pipeline/parsers/ltsv.md)

administration/configuring-fluent-bit/yaml.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ don't support, like processors.
88

99
YAML configuration files support the following top-level sections:
1010

11-
- `env`: Configures [environment variables](../administration/configuring-fluent-bit/yaml/environment-variables-section.md).
12-
- `includes`: Specifies additional YAML configuration files to [include as part of a parent file](../administration/configuring-fluent-bit/yaml/includes-section.md).
13-
- `service`: Configures global properties of the Fluent Bit [service](../administration/configuring-fluent-bit/yaml/service-section.md).
14-
- `pipeline`: Configures active [`inputs`, `filters`, and `outputs`](../administration/configuring-fluent-bit/yaml/pipeline-section.md).
15-
- `parsers`: Defines [custom parsers](../administration/configuring-fluent-bit/yaml/parsers-section.md).
16-
- `multiline_parsers`: Defines [custom multiline parsers](../administration/configuring-fluent-bit/yaml/multiline-parsers-section.md).
17-
- `plugins`: Defines paths for [custom plugins](../administration/configuring-fluent-bit/yaml/plugins-section.md).
18-
- `upstream_servers`: Defines [nodes](../administration/configuring-fluent-bit/yaml/upstream-servers-section.md) for output plugins.
11+
- `env`: Configures [environment variables](./yaml/environment-variables-section.md).
12+
- `includes`: Specifies additional YAML configuration files to [include as part of a parent file](./yaml/includes-section.md).
13+
- `service`: Configures global properties of the Fluent Bit [service](./yaml/service-section.md).
14+
- `pipeline`: Configures active [`inputs`, `filters`, and `outputs`](./yaml/pipeline-section.md).
15+
- `parsers`: Defines [custom parsers](./yaml/parsers-section.md).
16+
- `multiline_parsers`: Defines [custom multiline parsers](./yaml/multiline-parsers-section.md).
17+
- `plugins`: Defines paths for [custom plugins](./yaml/plugins-section.md).
18+
- `upstream_servers`: Defines [nodes](./yaml/upstream-servers-section.md) for output plugins.
1919

2020
{% hint style="info" %}
2121
YAML configuration is used in the smoke tests for containers. An always-correct up-to-date example is here: <https://github.com/fluent/fluent-bit/blob/master/packaging/testing/smoke/container/fluent-bit.yaml>.

administration/configuring-fluent-bit/yaml/multiline-parsers-section.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
# Multiline parsers
22

3-
Multiline parsers are used to combine logs that span multiple events into a single, cohesive message. Use this parser for handling stack traces, error logs, or any log entry that contains multiple lines of information.
3+
You can define custom [multiline parsers](../../pipeline/parsers/multiline-parsing.md) in the `multiline_parsers` section of YAML configuration files.
44

5-
In YAML configuration, the syntax for defining multiline parsers differs slightly from the classic configuration format introducing minor breaking changes, specifically on how the rules are defined.
5+
{% hint style="info" %}
66

7-
The following example demonstrates how to define a multiline parser directly in the main configuration file, and how to include additional definitions from external files:
7+
To define standard custom parsers, use [the `parsers` section](./parsers-section.md) of YAML configuration files.
8+
9+
{% endhint %}
10+
11+
## Syntax
12+
13+
To define custom parsers in the `multiline_parsers` section of a YAML configuration file, use the following syntax:
14+
15+
{% tabs %}
16+
{% tab title="fluent-bit.yaml" %}
817

918
```yaml
1019
multiline_parsers:
@@ -20,6 +29,9 @@ multiline_parsers:
2029
next_state: cont
2130
```
2231
32+
{% endtab %}
33+
{% endtabs %}
34+
2335
This example defines a multiline parser named `multiline-regex-test` that uses regular expressions to handle multi-event logs. The parser contains two rules: the first rule transitions from `start_state` to cont when a matching log entry is detected, and the second rule continues to match subsequent lines.
2436

25-
For more detailed information on configuring multiline parsers, including advanced options and use cases, refer to the Configuring Multiline Parsers documentation.
37+
For information about supported configuration options for custom multiline parsers, see [configuring multiline parsers](../../pipeline/parsers/multiline-parsing.md#configuring-multiline-parsers).

administration/configuring-fluent-bit/yaml/parsers-section.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ You can define customer [parsers](../pipeline/parsers.md) in the `parsers` secti
44

55
{% hint style="info" %}
66

7-
To define custom multiline parsers, use [the `multiline_parsers` section](../administration/configuring-fluent-bit/yaml/multiline-parsers-section.md) of YAML configuration files.
7+
To define custom multiline parsers, use [the `multiline_parsers` section](./multiline-parsers-section.md) of YAML configuration files.
88

99
{% endhint %}
1010

1111
## Syntax
1212

13-
To define customers parsers in the `parsers` section of a YAML configuration file, use the following syntax.
13+
To define custom parsers in the `parsers` section of a YAML configuration file, use the following syntax.
1414

1515
{% tabs %}
1616
{% tab title="fluent-bit.yaml" %}
@@ -35,7 +35,7 @@ parsers:
3535
{% endtab %}
3636
{% endtabs %}
3737
38-
For information about supported configuration options for custom parsers, see [configuring parsers](../pipeline/parsers/configuring-parser.md).
38+
For information about supported configuration options for custom parsers, see [configuring parsers](../../pipeline/parsers/configuring-parser.md).
3939
4040
## Standalone parsers files
4141

pipeline/filters/multiline-stacktrace.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Along with multiline filters, you can enable one of the following built-in Fluen
1515

1616
When using this filter:
1717

18-
- The usage of this filter depends on a previous configuration of a [multiline parser](../../administration/configuring-fluent-bit/multiline-parsing.md) definition.
18+
- The usage of this filter depends on a previous configuration of a [multiline parser](../pipeline/parsers/multiline-parsing.md) definition.
1919
- To concatenate messages read from a log file, it's highly recommended to use the multiline support in the [Tail plugin](https://docs.fluentbit.io/manual/pipeline/inputs/tail#multiline-support) itself. This is because performing concatenation while reading the log file is more performant. Concatenating messages that were originally one line, but split by Docker or CRI container engines because of their size, is supported in the [Tail plugin](https://docs.fluentbit.io/manual/pipeline/inputs/tail#multiline-support) in combination with the `docker` or `cri` parser. To concatenate application logs like stacktraces on top of that, you can use this multiline filter.
2020

2121
{% hint style="warning" %}
@@ -40,7 +40,7 @@ The plugin supports the following configuration parameters:
4040

4141
| Property | Description |
4242
| -------- | ----------- |
43-
| `multiline.parser` | Specify one or multiple [Multiline Parser definitions](../../administration/configuring-fluent-bit/multiline-parsing.md) to apply to the content. You can specify multiple multiline parsers to detect different formats by separating them with a comma. |
43+
| `multiline.parser` | Specify one or multiple [Multiline Parser definitions](../pipeline/parsers/multiline-parsing.md) to apply to the content. You can specify multiple multiline parsers to detect different formats by separating them with a comma. |
4444
| `multiline.key_content` | Key name that holds the content to process. A multiline parser definition can specify the `key_content` This option allows for overwriting that value for the purpose of the filter. |
4545
| `mode` | Mode can be `parser` for regular expression concatenation, or `partial_message` to concatenate split Docker logs. |
4646
| `buffer` | Enable buffered mode. In buffered mode, the filter can concatenate multiple lines from inputs that ingest records one by one (like Forward), rather than in chunks, re-emitting them into the beginning of the pipeline (with the same tag) using the `in_emitter` instance. With buffer off, this filter won't work with most inputs, except Tail. |
@@ -68,7 +68,7 @@ service:
6868
flush: 1
6969
log_level: info
7070
parsers_file: parsers_multiline.yaml
71-
71+
7272
pipeline:
7373
inputs:
7474
- name: tail
@@ -157,10 +157,10 @@ This file defines a multiline parser for the example. A second multiline parser
157157
# Regex rules for multiline parsing
158158
# ---------------------------------
159159
#
160-
# configuration hints:
160+
# configuration hints:
161161
#
162162
# - first state always has the name: start_state
163-
# - every field in the rule must be inside double quotes
163+
# - every field in the rule must be inside double quotes
164164
#
165165
# rules | state name | regex pattern | next state
166166
# ------|---------------|--------------------------------------------
@@ -314,7 +314,7 @@ Lines that don't match a pattern aren't considered as part of the multiline mess
314314

315315
## Docker partial message use case
316316

317-
When Fluent Bit is consuming logs from a container runtime, such as Docker, these logs will be split when larger than a certain limit, usually 16&nbspKB.
317+
When Fluent Bit is consuming logs from a container runtime, such as Docker, these logs will be split when larger than a certain limit, usually 16&nbspKB.
318318
If your application emits a 100K log line, it will be split into seven partial messages. The docker parser will merge these back to one line. If instead you are using the [Fluentd Docker Log Driver](https://docs.docker.com/config/containers/logging/fluentd/) to send the logs to Fluent Bit, they might look like this:
319319

320320
```text

pipeline/inputs/tail.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,9 @@ Multiline core is exposed by the following configuration:
158158

159159
| Key | Description |
160160
|:-------------------|:---------------|
161-
| `multiline.parser` | Specify one or multiple [Multiline Parser definitions](../../administration/configuring-fluent-bit/multiline-parsing.md) to apply to the content. |
161+
| `multiline.parser` | Specify one or multiple [Multiline Parser definitions](../parsers/multiline-parsing.md) to apply to the content. |
162162

163-
[Multiline Parser](../../administration/configuring-fluent-bit/multiline-parsing.md) provides built-in configuration modes. When using a new `multiline.parser` definition, you must disable the old configuration from your tail section like:
163+
[Multiline Parser](../parsers/multiline-parsing.md) provides built-in configuration modes. When using a new `multiline.parser` definition, you must disable the old configuration from your tail section like:
164164

165165
- `parser`
166166
- `parser_firstline`

pipeline/parsers.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,19 @@ For example, a parser can turn an unstructured log entry like this:
3939

4040
## How parsers work
4141

42-
Parsers modify the data ingested by input plugins. This modification happens before Fluent Bit applies any [filters](../pipeline/filters.md) or [processors](..pipeline/processors.md) to that data.
42+
Parsers modify the data ingested by input plugins. This modification happens before Fluent Bit applies any [filters](../pipeline/filters.md) or [processors](../pipeline/processors.md) to that data.
4343

4444
Each input plugin can have one active parser. Multiple plugins within the same Fluent Bit configuration file can use the same parser or use different parsers from each other.
4545

4646
### Default parsers and custom parsers
4747

48-
Fluent Bit includes a variety of [default parsers](https://github.com/fluent/fluent-bit/blob/master/conf/parsers.conf) for parsing common data formats, like Apache and Docker logs. You can also [define custom parsers](../configuring-fluent-bit/yaml/parsers-section.md).
48+
Fluent Bit includes a variety of [default parsers](https://github.com/fluent/fluent-bit/blob/master/conf/parsers.conf) for parsing common data formats, like Apache and Docker logs. You can also [define custom parsers](../administration/configuring-fluent-bit/yaml/parsers-section.md).
4949

5050
## Add a parser to an input plugin
5151

5252
To add a parser to an input plugin, follow these steps.
5353

54-
1. Either identify the name of the [default parser](https://github.com/fluent/fluent-bit/blob/master/conf/parsers.conf) you want to use, or [define a custom parser](../configuring-fluent-bit/yaml/parsers-section.md) with your desired [configuration settings](../pipeline/parsers/configuring-parser.md).
54+
1. Either identify the name of the [default parser](https://github.com/fluent/fluent-bit/blob/master/conf/parsers.conf) you want to use, or [define a custom parser](../administration/configuring-fluent-bit/yaml/parsers-section.md) with your desired [configuration settings](../pipeline/parsers/configuring-parser.md).
5555

5656
1. Add a `parsers` key to the plugin's settings in the [`inputs`](../administration/configuring-fluent-bit/yaml/pipeline-section.md#inputs) section of your YAML configuration file.
5757

pipeline/parsers/configuring-parser.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Configuring custom parsers
22

3-
Use the information on this page to configure custom [parsers](../pipeline/parsers).
3+
Use the information on this page to configure custom [parsers](../parsers.md).
44

55
{% hint style="info" %}
66

7-
To define a custom parser, add an entry to the [`parsers` section](../configuring-fluent-bit/yaml/parsers-section.md) of your YAML configuration file, or create a [standalone parser file](../administration/configuring-fluent-bit/yaml/parsers-section.md#standalone-parsers-files).
7+
To define a custom parser, add an entry to the [`parsers` section](../administration/configuring-fluent-bit/yaml/parsers-section.md) of your YAML configuration file, or create a [standalone parser file](../administration/configuring-fluent-bit/yaml/parsers-section.md#standalone-parsers-files).
88

99
{% endhint %}
1010

0 commit comments

Comments
 (0)