> 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/data-pipeline/outputs/output_formats.md).

# Output Formats

Some output plugins have a `format` configuration parameter. Supported values vary by plugin:

| Plugin          | Supported formats                                          |
| --------------- | ---------------------------------------------------------- |
| HTTP            | `gelf`, `json`, `json_lines`, `json_stream`, `msgpack`     |
| Kafka           | `avro` (build-dependent), `gelf`, `json`, `msgpack`, `raw` |
| Standard Output | `json`, `json_lines`, `json_stream`, `msgpack`             |
| TCP/TLS         | `json`, `json_lines`, `json_stream`, `msgpack`             |
| UDP             | `json`, `json_lines`, `json_stream`, `msgpack`             |
| WebSocket       | `gelf`, `json`, `json_lines`, `json_stream`, `msgpack`     |

Some plugins, such as Kafka, support additional formats not listed here (for example, `avro` and `raw`). Always check the individual plugin documentation for the full list of supported values.

The format specifications and references to external documentation are available in this page.

## JSON formats

The most custom format options are the JSON types. The following are common variants of sending JSON encoded data over various APIs.

The following example payloads are modified for readability.

Records shown in example payloads are the three first commits of the Fluent Bit repository.

### Nesting depth limit

In Fluent Bit version 5.1.3 and greater, converting a record to any of these JSON formats serializes at most 512 levels of nested maps and arrays. Maps and arrays through level 512 are preserved. When a record nests deeper than this limit, Fluent Bit writes each non-empty map or array at level 513 as `null`, omits its contents, and keeps the rest of the record intact. An empty map or array at level 513 is still written as `{}` or `[]`.

Fluent Bit logs the following warning at most once for each serialization pass, no matter how many branches are affected:

```
[warn] [pack] msgpack to JSON conversion exceeded the maximum nesting depth (512), truncating remaining structure
```

With `json`, a pass covers the full array of queued records. With `json_lines` and `json_stream`, a pass covers one record. If the output buffer is too small, Fluent Bit grows it and retries in a new pass, which can log the warning again.

### `json`

Queued records encoded as a single JSON array of JSON encoded Fluent Bit records.

#### Example payload

```json
[
  {
    "timestamp": 1398282091.000,
    "log": "Core: initialization and 32 bit fixes.",
    "commit": "b327996bfcbc0f1f47e62c862c6f303592dfacea",
    "author": "Eduardo Silva"
  },
  {
    "timestamp": 1422350608.000,
    "log": "Initial import.",
    "commit": "49269c5ec3c74411943e362cfef85052665ae97f",
    "author": "Eduardo Silva"
  },
  {
    "timestamp": 1422418113.000,
    "log": "Doc: add reference to Apache License v2.0",
    "commit": "6e09478733e8273ec216328dfc921e622740695d",
    "author": "Eduardo Silva"
  }
]
```

### `json_stream`

*a.k.a. Concatenated JSON*

Queued JSON-encoded Fluent Bit records, with no separator between records.

#### Example `json_stream` payload

```json
{
  "timestamp": 1398282091.000,
  "log": "Core: initialization and 32 bit fixes.",
  "commit": "b327996bfcbc0f1f47e62c862c6f303592dfacea",
  "author": "Eduardo Silva"
}{
  "timestamp": 1422350608.000,
  "log": "Initial import.",
  "commit": "49269c5ec3c74411943e362cfef85052665ae97f",
  "author": "Eduardo Silva"
}{
  "timestamp": 1422418113.000,
  "log": "Doc: add reference to Apache License v2.0",
  "commit": "6e09478733e8273ec216328dfc921e622740695d",
  "author": "Eduardo Silva"
}
```

### `json_lines`

Also known as newline-delimited JSON.

Queued JSON-encoded Fluent Bit records, separated by line-breaks (`\n`).

#### Example `json_lines` payload

```json
{
  "timestamp": 1398282091.000,
  "log": "Core: initialization and 32 bit fixes.",
  "commit": "b327996bfcbc0f1f47e62c862c6f303592dfacea",
  "author": "Eduardo Silva"
}
{
  "timestamp": 1422350608.000,
  "log": "Initial import.",
  "commit": "49269c5ec3c74411943e362cfef85052665ae97f",
  "author": "Eduardo Silva"
}
{
  "timestamp": 1422418113.000,
  "log": "Doc: add reference to Apache License v2.0",
  "commit": "6e09478733e8273ec216328dfc921e622740695d",
  "author": "Eduardo Silva"
}
```

## `msgpack`

MessagePack is a binary format for serializing objects.

Refer to the official [MessagePack format specification](https://github.com/msgpack/msgpack/blob/master/spec.md).

## GELF

Graylog Extended Log Format (GELF) is a JSON based log format which is designed to avoid the shortcomings of classic plain syslog.

See the official documentation for the [GELF format](https://archivedocs.graylog.org/en/latest/pages/gelf.html).

It uses a fixed set of keys, with the addition of adding custom keys prefixed by one single underscore character.

### Example GELF payload

Here is an example payload, copied directly from the official documentation.

```json
{
  "version": "1.1",
  "host": "example.org",
  "short_message": "A short message that helps you identify what is going on",
  "full_message": "Backtrace here\n\nmore stuff",
  "timestamp": 1385053862.3072,
  "level": 1,
  "_user_id": 9001,
  "_some_info": "foo",
  "_some_env_var": "bar"
}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.fluentbit.io/manual/data-pipeline/outputs/output_formats.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
