From 7f0858a22f26494b677be0101beebf22a7230ab3 Mon Sep 17 00:00:00 2001 From: jantti Date: Wed, 25 Dec 2024 15:53:44 +0900 Subject: [PATCH] out_loki: make it clear setting labels removes the keys from record Related to the pull request https://github.com/fluent/fluent-bit/pull/9766 The documentation doesn't make it clear, but the code seems to be trying to work this way. Also minor typo fix. --- pipeline/outputs/loki.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pipeline/outputs/loki.md b/pipeline/outputs/loki.md index ec68f1bb2..160738361 100644 --- a/pipeline/outputs/loki.md +++ b/pipeline/outputs/loki.md @@ -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\): @@ -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.