From 61b103a8c7cd639a9ab3b9b0ff24d8e66b328a44 Mon Sep 17 00:00:00 2001 From: Dominik Rosiek Date: Mon, 2 Oct 2023 11:53:32 +0200 Subject: [PATCH 1/2] docs: document json format Signed-off-by: Dominik Rosiek --- docs/collecting-container-logs.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/docs/collecting-container-logs.md b/docs/collecting-container-logs.md index df25915011..edd26c69cc 100644 --- a/docs/collecting-container-logs.md +++ b/docs/collecting-container-logs.md @@ -2,6 +2,27 @@ +- [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) + By default, log collection is enabled. This includes both container logs and systemd logs. This document covers container logs. @@ -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. From d7de34388fffb4c50a0de8069980f5a994d00402 Mon Sep 17 00:00:00 2001 From: Dominik Rosiek Date: Mon, 2 Oct 2023 12:29:38 +0200 Subject: [PATCH 2/2] chore: format Signed-off-by: Dominik Rosiek --- docs/collecting-container-logs.md | 38 +++++++++++++++---------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/collecting-container-logs.md b/docs/collecting-container-logs.md index edd26c69cc..c6f1b51388 100644 --- a/docs/collecting-container-logs.md +++ b/docs/collecting-container-logs.md @@ -3,25 +3,25 @@ - [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) + - [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)