Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

out_loki: make it clear setting labels removes the keys from record #1536

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pipeline/outputs/loki.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Be aware there is a separate Golang output plugin provided by [Grafana](https://

## Labels

Loki store the record logs inside Streams, a stream is defined by a set of labels, at least one label is required.
Loki stores the record logs inside Streams, a stream is defined by a set of labels, at least one label is required.

Fluent Bit implements a flexible mechanism to set labels by using fixed key/value pairs of text but also allowing to set as labels certain keys that exists as part of the records that are being processed.
Consider the following JSON record \(pretty printed for readability\):
Expand Down Expand Up @@ -88,6 +88,8 @@ When processing that new configuration, the internal labels will be:
job="fluentbit", mystream="stdout"
```

Extracting keys to labels through `labels`, `label_keys` or `label_map_path` will remove those keys from the record.

### Using the `label_keys` property

The additional configuration property called `label_keys` allow to specify multiple record keys that needs to be placed as part of the outgoing Stream Labels, yes, this is a similar feature than the one explained above in the `labels` property.
Expand Down