jsonlogencodingextension

package module
v0.119.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2025 License: Apache-2.0 Imports: 9 Imported by: 2

README

JSON Log encoding extension

Status
Stability alpha
Distributions []
Issues Open issues Closed issues
Code Owners @VihasMakwana, @atoulme

Configuration

Name Description Default
mode What mode of the JSON encoding extension you want body
Mode
body Mode

The body mode of the JSON encoding extension is used to marshal or unmarshal the JSON log body, ignoring other log fields.

body_with_inline_attributes

The body_with_inline_attributes mode within the JSON encoding extension grabs the resource and attributes and adds them as key value pairs to the JSON body. It iterates through all the logs and creates a JSON array like the following example:

[
  {
    "body": {
      "log": "test"
    },
    "resourceAttributes": {
      "test": "logs-test"
    },
    "logAttributes": {
      "foo": "bar"
    }
  },
  {
    "body": "log testing",
    "resource": {
      "test": "logs-test"
    }
  }
]

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() extension.Factory

Types

type Config

type Config struct {
	// Export raw log string instead of log wrapper
	Mode JSONEncodingMode `mapstructure:"mode,omitempty"`
}

func (*Config) Validate

func (c *Config) Validate() error

type JSONEncodingMode added in v0.101.0

type JSONEncodingMode string
const (
	JSONEncodingModeBodyWithInlineAttributes JSONEncodingMode = "body_with_inline_attributes"
	JSONEncodingModeBody                     JSONEncodingMode = "body"
)

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL