Skip to content

Commit

Permalink
docs: document json format (#3313)
Browse files Browse the repository at this point in the history
* docs: document json format

Signed-off-by: Dominik Rosiek <[email protected]>

* chore: format

Signed-off-by: Dominik Rosiek <[email protected]>

---------

Signed-off-by: Dominik Rosiek <[email protected]>
  • Loading branch information
sumo-drosiek authored Oct 2, 2023
1 parent 2c2f920 commit fd13a90
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions docs/collecting-container-logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@

<!-- TOC -->

- [Collecting Container Logs](#collecting-container-logs)
- [Configuration](#configuration)
- [Multiline log parsing](#multiline-log-parsing)
- [Conditional multiline log parsing](#conditional-multiline-log-parsing)
- [Log format](#log-format)
- [json log format](#json-log-format)
- [fields log format](#fields-log-format)
- [json_merge log format](#json_merge-log-format)
- [text log format](#text-log-format)
- [Problem](#problem)
- [Resolution](#resolution)
- [Setting source name and other built-in metadata](#setting-source-name-and-other-built-in-metadata)
- [Filtering](#filtering)
- [Modifying log records](#modifying-log-records)
- [Adding custom fields](#adding-custom-fields)
- [Persistence](#persistence)
- [Advanced Configuration](#advanced-configuration)
- [Direct configuration](#direct-configuration)
- [Disabling container logs](#disabling-container-logs)
- [Using OTLP Source](#using-otlp-source)

<!-- /TOC -->

By default, log collection is enabled. This includes both container logs and systemd logs. This document covers container logs.
Expand Down Expand Up @@ -138,6 +159,12 @@ We're going to demonstrate the differences between them on two example log lines
{ "log_property": "value", "text": "I am a json log" }
```

#### `json` log format

`json` log format is an alias for `fields` log format.

See [`fields` log format](#fields-log-format)

#### `fields` log format

Logs formatted as `fields` are wrapped in a JSON object with additional properties, with the log body residing under the `log` key.
Expand Down

0 comments on commit fd13a90

Please sign in to comment.