Skip to content

Commit 933e836

Browse files
committed
Adding YAML examples to logfmt parser doc. Part of issue #1865.
Signed-off-by: Eric D. Schabell <[email protected]>
1 parent 9ae64ff commit 933e836

File tree

1 file changed

+34
-3
lines changed

1 file changed

+34
-3
lines changed

pipeline/parsers/logfmt.md

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,29 @@
22

33
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) .
44

5-
Here is an example configuration:
5+
Here is an example parsers configuration:
66

7-
```python
7+
{% tabs %}
8+
{% tab title="parsers.yaml" %}
9+
10+
```yaml
11+
parsers:
12+
- name: logfmt
13+
format: logfmt
14+
```
15+
16+
{% endtab %}
17+
{% tab title="parsers.conf" %}
18+
19+
```text
820
[PARSER]
921
Name logfmt
1022
Format logfmt
1123
```
1224

25+
{% endtab %}
26+
{% endtabs %}
27+
1328
The following log entry is a valid content for the parser defined above:
1429

1530
```text
@@ -27,9 +42,25 @@ After processing, it internal representation will be:
2742
If you want to be more strict than the logfmt standard and not parse lines where some attributes do
2843
not have values (such as `key3`) in the example above, you can configure the parser as follows:
2944

30-
```python
45+
{% tabs %}
46+
{% tab title="parsers.yaml" %}
47+
48+
```yaml
49+
parsers:
50+
- name: logfmt
51+
format: logfmt
52+
logfmt_no_bare_keys: true
53+
```
54+
55+
{% endtab %}
56+
{% tab title="parsers.conf" %}
57+
58+
```text
3159
[PARSER]
3260
Name logfmt
3361
Format logfmt
3462
Logfmt_No_Bare_Keys true
3563
```
64+
65+
{% endtab %}
66+
{% endtabs %}

0 commit comments

Comments
 (0)