Menu
Open source
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
output:
# Name from extracted data to use for the log entry.
source: <string>
Example
For the given pipeline:
yaml
- json:
expressions:
user: user
message: message
- labels:
user:
- output:
source: message
And the given log line:
{"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!
Was this page helpful?
Related resources from Grafana Labs
Additional helpful documentation, links, and articles:

Getting started with logging and Grafana Loki
See a demo of the updated features in Loki, and how to create metrics from logs and alert on your logs with powerful Prometheus-style alerting rules.

Essential Grafana Loki configuration settings
This webinar focuses on Grafana Loki configuration including agents Promtail and Docker; the Loki server; and Loki storage for popular backends.

Scaling and securing your logs with Grafana Loki
This webinar covers the challenges of scaling and securing logs, and how Grafana Enterprise Logs powered by Grafana Loki can help, cost-effectively.