Menu
Enterprise
static_labels
The static_labels stage is an action stage that adds static-labels to the label set that is sent to Loki with the log entry.
Schema
yaml
static_labels:
[ <string>: [<string>] ... ]
Examples
For the given pipeline:
yaml
- json:
expressions:
stream: stream
- labels:
stream:
- static_labels:
custom_key: custom_val
Given the following log line:
{"log":"log message\n","stream":"stderr","time":"2019-04-30T02:12:41.8443515Z"}
The first stage would extract stream
into the extracted map with a value of
stderr
. The labels
stage would turn that key-value pair into a label. The
static_labels
stage would add the provided static labels into the label set.
The resulting entry that is sent to Loki will contain stream="stderr"
and custom_key="custom_val"
as labels.
Was this page helpful?
Related documentation
Related resources from Grafana Labs
Additional helpful documentation, links, and articles:
Video
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.
Video
Managing privacy in log data with Grafana Loki
Laws for data privacy are complex and rapidly changing. During this webinar, we will show how Grafana Loki can help organizations meet these requirements.