json

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

README

Json Serializer Plugin

The json serializer plugin converts events into json.

Configuration

[[outputs]]
  [outputs.log]
  [outputs.log.serializer]
    type = "json"

    # plugin mode, "jsonl" or "array"
    # in array mode all passed events will be merged into an array of objects
    # in jsonl mode events are combined in jsonl document with new line as a separator
    mode = "jsonl"

    # if true, parser uses only event data map
    # otherwise, it uses the whole event
    data_only = true

    # if true, parser ignores serialization errors
    # and skips failed events
    omit_failed = true

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Json

type Json struct {
	*core.BaseSerializer `mapstructure:"-"`
	DataOnly             bool   `mapstructure:"data_only"`
	OmitFailed           bool   `mapstructure:"omit_failed"`
	Mode                 string `mapstructure:"mode"`
	// contains filtered or unexported fields
}

func (*Json) Close

func (s *Json) Close() error

func (*Json) Init

func (s *Json) Init() error

func (*Json) Serialize

func (s *Json) Serialize(events ...*core.Event) ([]byte, error)

Jump to

Keyboard shortcuts

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