---
title: "output | Grafana Loki documentation"
description: "The 'output' Promtail pipeline stage."
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# output

The `output` stage is an action stage that takes data from the extracted map and changes the log line that will be sent to Loki.

## Schema

YAML ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```yaml
output:
  # Name from extracted data to use for the log entry.
  source: <string>
```

## Example

For the given pipeline:

YAML ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```yaml
- json:
    expressions:
      user: user
      message: message
- labels:
    user:
- output:
    source: message
```

And the given log line:

![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```none
{"user": "alexis", "message": "hello, world!"}
```

Then the first stage will extract the following key-value pairs into the extracted map:

- `user`: `alexis`
- `message`: `hello, world!`

The second stage will then add `user=alexis` to the label set for the outgoing log line, and the final `output` stage will change the log line from the original JSON to `hello, world!`
