Skip to content

Commit 3cefdce

Browse files
esmerelcnorris-cs
andauthored
Apply suggestions from code review
Co-authored-by: Craig Norris <[email protected]> Signed-off-by: Lynette Miles <[email protected]>
1 parent ad7b154 commit 3cefdce

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

pipeline/outputs/loki.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ There is a separate Golang output plugin provided by [Grafana](https://grafana.c
3535

3636
## Labels
3737

38-
Loki stores the record logs inside Streams. A _stream_ is defined by a set of labels, at least one label is required.
38+
Loki stores the record logs inside Streams. A stream is defined by a set of labels, and at least one label is required.
3939

4040
Fluent Bit implements a flexible mechanism to set labels by using fixed key/value pairs of text. It also allows setting as labels certain keys that exists as part of the records that are being processed.
4141

@@ -67,7 +67,7 @@ If you decide that your Loki Stream will be composed by two labels called `job`
6767

6868
The label `job` has the value `fluentbit` and the second label is configured to access the nested map called `sub` targeting the value of the key `stream` .
6969

70-
The second label name must start with a dollar sign `$`, meaning it's a [Record Accessor](../../administration/configuring-fluent-bit/classic-mode/record-accessor.md) pattern which provides the ability to retrieve values from nested maps by using the key names.
70+
The second label name must start with a dollar sign `$`, meaning it's a [Record Accessor](../../administration/configuring-fluent-bit/classic-mode/record-accessor.md) pattern, which provides the ability to retrieve values from nested maps by using the key names.
7171

7272
When processing the previous configuration, internally the ending labels for the stream in question becomes:
7373

@@ -164,7 +164,7 @@ job="fluentbit", stream="stdout"
164164

165165
#### Kubernetes and labels
166166

167-
If you are running in a Kubernetes environment, consider enabling the `auto_kubernetes_labels` option, which auto-populates the streams with the Pod labels for you. Consider the following configuration:
167+
If you're running in a Kubernetes environment, consider enabling the `auto_kubernetes_labels` option, which auto-populates the streams with the Pod labels for you. Consider the following configuration:
168168

169169
```python
170170
[OUTPUT]
@@ -182,7 +182,7 @@ job="fluentbit", team="Santiago Wanderers"
182182

183183
## Use `drop_single_key`
184184

185-
If there is only one key remaining after removing keys, you can use the `drop_single_key` property to send its value to Loki, rather than a single `key=value` pair.
185+
If there's only one key remaining after removing keys, you can use the `drop_single_key` property to send its value to Loki, rather than a single `key=value` pair.
186186

187187
Consider this JSON example:
188188

@@ -212,8 +212,8 @@ If `drop_single_key` is `raw`, or `line_format` is `key_value`, it will show in
212212
value
213213
```
214214

215-
If you want both structured JSON and plain text logs in Loki, you should set `drop_single_key` to `raw` and `line_format` to `json`.
216-
Loki doesn't interpret a quoted string as valid JSON.T o remove the quotes without `drop_single_key` set to `raw`, you would need to use a query like this:
215+
If you want both structured JSON and plain text logs in Loki, set `drop_single_key` to `raw` and `line_format` to `json`.
216+
Loki doesn't interpret a quoted string as valid JSON. To remove the quotes without `drop_single_key` set to `raw`, use a query like this:
217217

218218
```C
219219
{"job"="fluent-bit"} | regexp `^"?(?P<log>.*?)"?$` | line_format "{{.log}}"
@@ -233,7 +233,7 @@ You can get the same behavior this flag provides in Loki with `drop_single_key`
233233
234234
## Use `structured_metadata`
235235
236-
[Structured metadata](https://grafana.com/docs/loki/latest/get-started/labels/structured-metadata/) lets you attach custom fields to individual log lines without embedding the information in the content of the log line. This capability works well for high cardinality data that isn't suited for using labels. While not a label, the `structured_metadata` configuration parameter operates similarly to the `labels` parameter. Both parameters are comma-delimited `key=value` lists, and both can use record accessors to reference keys within the record being processed.
236+
[Structured metadata](https://grafana.com/docs/loki/latest/get-started/labels/structured-metadata/) lets you attach custom fields to individual log lines without embedding the information in the content of the log line. This capability works well for high cardinality data that isn't suited for using labels. Although not a label, the `structured_metadata` configuration parameter operates similarly to the `labels` parameter. Both parameters are comma-delimited `key=value` lists, and both can use record accessors to reference keys within the record being processed.
237237
238238
The following configuration:
239239
@@ -259,7 +259,7 @@ with Loki deployments prior to Loki 3.0.
259259

260260
In addition to the `structured_metadata` configuration parameter, a `structured_metadata_map_keys` is available, which can be used to dynamically populate structured metadata from map values in the log record. `structured_metadata_map_keys` can be set with a list of record accessors, where each one should reference map values in the log record. Record accessors which don't match a map value will be skipped.
261261

262-
The following configuration is similar to the previous example, except now all entries in the log record map value `$kubernetes` will be used as structured metadata entries.
262+
The following configuration is similar to the previous example, except now all entries in the log record map value `$kubernetes` will be used as structured metadata entries:
263263

264264
{% tabs %}
265265
{% tab title="fluent-bit.conf" %}
@@ -328,7 +328,7 @@ All options mentioned in these articles must be enabled in the plugin configurat
328328

329329
Fluent Bit supports sending logs and metrics to [Grafana Cloud](https://grafana.com/products/cloud/) by providing the appropriate URL and ensuring TLS is enabled.
330330

331-
An example configuration, set the credentials and ensure the host URL matches the correct one for your deployment:
331+
Aa an example configuration, set the credentials and ensure the host URL matches the correct one for your deployment:
332332

333333
```python
334334
[OUTPUT]

0 commit comments

Comments
 (0)