Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions pipeline/parsers/logfmt.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Logfmt

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) .
The _logfmt_ parser lets you parse data in the [logfmt](https://pkg.go.dev/github.com/kr/logfmt?utm_source=godoc) format.

Here is an example parsers configuration:

Expand All @@ -25,22 +25,21 @@ parsers:
{% endtab %}
{% endtabs %}

The following log entry is a valid content for the parser defined above:
The following log entry is valid for the previously defined parser:

```text
key1=val1 key2=val2 key3
```

After processing, it internal representation will be:
After processing, its internal representation will be:

```text
[1540936693, {"key1"=>"val1",
"key2"=>"val2"
"key3"=>true}]
```

If you want to be more strict than the logfmt standard and not parse lines where some attributes do
not have values (such as `key3`) in the example above, you can configure the parser as follows:
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:

{% tabs %}
{% tab title="parsers.yaml" %}
Expand All @@ -63,4 +62,4 @@ parsers:
```

{% endtab %}
{% endtabs %}
{% endtabs %}
1 change: 1 addition & 0 deletions vale-styles/FluentBit/Spelling-exceptions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ Kusto
labelset
librdkafka
loadgenerator
logfmt
Logstash
Lua
Lucene
Expand Down