> For the complete documentation index, see [llms.txt](https://docs.fluentbit.io/manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fluentbit.io/manual/administration/configuring-fluent-bit/yaml/multiline-parsers-section.md).

# Multiline parsers

You can define custom [multiline parsers](/manual/data-pipeline/parsers/multiline-parsing.md) in the `multiline_parsers` section of YAML configuration files.

{% hint style="info" %}
To define standard custom parsers, use [the `parsers` section](/manual/administration/configuring-fluent-bit/yaml/parsers-section.md) of YAML configuration files.
{% endhint %}

## Syntax

To define custom parsers in the `multiline_parsers` section of a YAML configuration file, use the following syntax:

{% tabs %}
{% tab title="fluent-bit.yaml" %}

```yaml
multiline_parsers:
  - name: multiline-regex-test
    type: regex
    flush_timeout: 1000
    rules:
      - state: start_state
        regex: '/([a-zA-Z]+ \d+ \d+:\d+:\d+)(.*)/'
        next_state: cont
      - state: cont
        regex: '/^\s+at.*/'
        next_state: cont
```

{% endtab %}
{% endtabs %}

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.

For information about supported configuration options for custom multiline parsers, see [configuring multiline parsers](/manual/data-pipeline/parsers/multiline-parsing.md#configuring-multiline-parsers).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.fluentbit.io/manual/administration/configuring-fluent-bit/yaml/multiline-parsers-section.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
