convert_log_level

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// > @3@4@5@6
	// >
	// > The name of the event field to convert.
	// > The value of the field will be converted to lower case and trimmed for parsing.
	// >
	// > Warn: it overrides fields if it contains non-object type on the path. For example:
	// > if `field` is `info.level` and input
	// > `{ "info": [{"userId":"12345"}] }`,
	// > output will be: `{ "info": {"level": <level>} }`
	Field  cfg.FieldSelector `json:"field" parse:"selector" required:"false" default:"level"` // *
	Field_ []string

	// > @3@4@5@6
	// >
	// > Style format to convert. Must be one of number or string.
	// > Available RFC-5424 levels:
	// > <ul>
	// > <li>0: emergency</li>
	// > <li>1: alert </li>
	// > <li>2: critical </li>
	// > <li>3: error </li>
	// > <li>4: warning </li>
	// > <li>5: notice </li>
	// > <li>6: informational </li>
	// > <li>7: debug </li>
	// > </ul>
	Style string `json:"style" default:"number" options:"number|string"` // *

	// > @3@4@5@6
	// >
	// > The default log level if the field cannot be parsed. If empty, no default level will be set.
	// >
	// > Also it uses if field contains non-object type. For example:
	// > if `default_level` is `informational` and input:
	// > `{"level":[5]}`
	// > the output will be: `{"level":"informational"}`
	DefaultLevel string `json:"default_level" default:""` // *

	// > @3@4@5@6
	// >
	// > Remove field if conversion fails.
	// > This can happen when the level is unknown. For example:
	// > `{ "level": "my_error_level" }`
	RemoveOnFail bool `json:"remove_on_fail" default:"false"` // *
}

! config-params ^ config-params

type Plugin

type Plugin struct {
	plugin.NoMetricsPlugin
	// contains filtered or unexported fields
}

func (*Plugin) Do

func (p *Plugin) Do(event *pipeline.Event) pipeline.ActionResult

func (*Plugin) Start

func (p *Plugin) Start(config pipeline.AnyConfig, params *pipeline.ActionPluginParams)

func (*Plugin) Stop

func (p *Plugin) Stop()

Jump to

Keyboard shortcuts

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