You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pipeline/parsers/logfmt.md
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Logfmt
2
2
3
-
The **logfmt** parser allows to parse the logfmt format described in [https://brandur.org/logfmt](https://brandur.org/logfmt) . A more formal description is in [https://godoc.org/github.com/kr/logfmt](https://godoc.org/github.com/kr/logfmt).
3
+
The _logfmt_ parser lets you parse data in the [logfmt](https://pkg.go.dev/github.com/kr/logfmt?utm_source=godoc) format.
4
4
5
5
Here is an example parsers configuration:
6
6
@@ -25,22 +25,21 @@ parsers:
25
25
{% endtab %}
26
26
{% endtabs %}
27
27
28
-
The following log entry is a valid content for the parser defined above:
28
+
The following log entry is valid for the previously defined parser:
29
29
30
30
```text
31
31
key1=val1 key2=val2 key3
32
32
```
33
33
34
-
After processing, it internal representation will be:
34
+
After processing, its internal representation will be:
35
35
36
36
```text
37
37
[1540936693, {"key1"=>"val1",
38
38
"key2"=>"val2"
39
39
"key3"=>true}]
40
40
```
41
41
42
-
If you want to be more strict than the logfmt standard and not parse lines where some attributes do
43
-
not have values (such as `key3`) in the example above, you can configure the parser as follows:
42
+
If you want to be more strict than the logfmt standard and not parse lines where certain keys lack values (such as `key3` in the previous example), you can configure the parser as follows:
0 commit comments