fieldswithcondition

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 (
	PluginName = "processor_fields_with_condition"

	RelationOperatorEquals    = "equals"
	RelationOperatorRegexp    = "regexp"
	RelationOperatorContains  = "contains"
	RelationOperatorStartwith = "startwith"

	LogicalOperatorAnd = "and"
	LogicalOperatorOr  = "or"

	ActionAddFieldsType = "processor_add_fields"
	ActionDropType      = "processor_drop"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Condition

type Condition struct {
	Case    ConditionCase            `comment:"The condition that log data satisfies"`
	Actions []map[string]interface{} `comment:"The action that executes when the case condition is met"`
	// contains filtered or unexported fields
}

type ConditionAction

type ConditionAction struct {
	Type          string                 `comment:"action type. alternate values are processor_add_fields/processor_drop"`
	IgnoreIfExist bool                   `comment:"Optional. Whether to ignore when the same key exists"`
	Fields        map[string]interface{} `comment:"The appending fields"`
	DropKeys      []interface{}          `comment:"The dropping fields"`
	// contains filtered or unexported fields
}

type ConditionCase

type ConditionCase struct {
	LogicalOperator  string            `comment:"Optional. The Logical operators between multiple conditional fields, alternate values are and/or"`
	RelationOperator string            `comment:"Optional. The Relational operators for conditional fields, alternate values are equals/regexp/contains/startwith"`
	FieldConditions  map[string]string `comment:"The key-value pair of field names and expressions"`
	// contains filtered or unexported fields
}

type Field

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

type FieldApply

type FieldApply func(reg *regexp.Regexp, conditionContent string, logContent string) bool

type ProcessorFieldsWithCondition

type ProcessorFieldsWithCondition struct {
	DropIfNotMatchCondition bool        `comment:"Optional. When the case condition is not met, whether the log is discarded (true) or retained (false)"`
	Switch                  []Condition `comment:"The switch-case conditions"`
	// contains filtered or unexported fields
}

func (*ProcessorFieldsWithCondition) Description

func (*ProcessorFieldsWithCondition) Description() string

func (*ProcessorFieldsWithCondition) Init

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

func (*ProcessorFieldsWithCondition) MatchAndProcess

func (p *ProcessorFieldsWithCondition) MatchAndProcess(log *protocol.Log) bool

Match different cases

func (*ProcessorFieldsWithCondition) ProcessLogs

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

Jump to

Keyboard shortcuts

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