# Formatters The formatter is the last flow stage. It turns a `core.LogEntry` into the byte payload that sinks write, applying a sanitizer policy on the way. ```toml [pipelines.flow.format] type = "json" sanitizer_policy = "json" flags = 0 timestamp_format = "" ``` One formatter serves the whole pipeline. Sinks receive an identical payload ending in a newline; under `raw` a message's own newlines stay, so a record can span lines. Apart from the `http` sink's SSE framing, only the console sink alters what it writes, escaping control characters on a terminal and painting level names ([console](sinks.md#console)). When you need two shapes of the same data, run two pipelines, or chain to a node that formats differently. Omitting `[pipelines.flow.format]` entirely selects `raw`. ## Options Each as type and default: - `type` (string, `raw`): `raw`, `txt`, or `json`. - `sanitizer_policy` (string, derived from `type`): `raw`, `txt`, `json`, or `shell`. - `flags` (int64, `0`): bitmask override; `0` selects a per-type default. - `timestamp_format` (string, `time.RFC3339Nano`): Go reference layout, e.g. `"2006-01-02T15:04:05Z07:00"`. ## Types ### raw Passthrough, the fastest type, for text already in its final form. `FlagRaw` bypasses formatting and sanitization: the message reaches the sink as the source produced it, control characters included, with no timestamp, level or source prefix added, and a newline appended unless the message ends in one. An entry that also carries `fields` gets the fields JSON appended verbatim after a single space, so `FlagRaw` (`1`) never drops data or re-encodes it. Heartbeats format without it, so in `raw` their `include_stats` fields print in Go's map syntax (`heartbeat map[beat_count:0 type:heartbeat]`), as any entry's fields do under a non-zero `flags` without `1`. ```toml [pipelines.flow.format] type = "raw" ``` The closest to verbatim transport is the `console` source, or the `file` source with `raw = true`. The whole line, terminator removed, becomes the message and `fields` stays empty; `raw` writes it back with one `\n`. It is not byte-exact: empty lines are skipped, CRLF becomes LF, and a line over 1 MiB, or one the `file` source reads while it is still being written, continues in the next entry. The `file` source's JSON branch splits a line into message and fields, so `raw` writes ` ` rather than the original object. ### txt Human-readable lines, `