Skip to content

Commit

Permalink
out_loki: make it clear setting labels removes the keys from record
Browse files Browse the repository at this point in the history
Related to the pull request fluent/fluent-bit#9766
The documentation doesn't make it clear, but the code seems to be
trying to work this way.

Also minor typo fix.
  • Loading branch information
ajantti committed Dec 25, 2024
1 parent c74f21f commit 7f0858a
Showing 1 changed file with 3 additions and 1 deletion.
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

0 comments on commit 7f0858a

Please sign in to comment.