anchor

package
v1.8.8 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StringType    = 1
	JSONType      = 2
	StringtypeStr = "string"
	JsontypeStr   = "json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Anchor

type Anchor struct {
	Start           string
	Stop            string
	FieldName       string
	FieldType       string
	ExpondJSON      bool
	IgnoreJSONError bool
	ExpondConnecter string
	MaxExpondDepth  int
	// contains filtered or unexported fields
}

Anchor is used to locate a substring with Start and Stop specified. The substring will be inserted into log with FieldName and FieldType. ExpondJSON indicates if the substring is JSON type, if this flag is set, the substring will be expanded to multiple key/value pairs, and values of pairs will be inserted into log with key prepended FieldName and ExpondConnector, such as fn_key1, fn_key2. ExpondJSON is used to specify depth to expand, 0 means no limit.

Note: Expond is a typo, but because this feature has already published, keep this typo for compatibility.

type ExpondParam

type ExpondParam struct {
	// contains filtered or unexported fields
}

func (*ExpondParam) ExpondJSONCallBack

func (p *ExpondParam) ExpondJSONCallBack(key []byte, value []byte, dataType jsonparser.ValueType, offset int) error

type ProcessorAnchor

type ProcessorAnchor struct {
	Anchors       []Anchor
	NoKeyError    bool
	NoAnchorError bool
	SourceKey     string
	KeepSource    bool
	// contains filtered or unexported fields
}

ProcessorAnchor is a processor plugin to process field with anchors. Field specified by SourceKey will be processed by all Anchors. If no SourceKey is specified, the first field in log contents will be processed.

func (*ProcessorAnchor) Description

func (*ProcessorAnchor) Description() string

func (*ProcessorAnchor) Init

func (p *ProcessorAnchor) Init(context pipeline.Context) error

Init called for init some system resources, like socket, mutex...

func (*ProcessorAnchor) ProcessAnchor

func (p *ProcessorAnchor) ProcessAnchor(log *protocol.Log, val *string)

func (*ProcessorAnchor) ProcessLog

func (p *ProcessorAnchor) ProcessLog(log *protocol.Log)

func (*ProcessorAnchor) ProcessLogs

func (p *ProcessorAnchor) ProcessLogs(logArray []*protocol.Log) []*protocol.Log

Jump to

Keyboard shortcuts

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