filter

package
v0.0.0-...-0a9c605 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Condition

type Condition struct {
	// Is true if KEY exists
	KeyExists string `json:"keyExists,omitempty"`
	// Is true if KEY does not exist
	KeyDoesNotExist map[string]string `json:"keyDoesNotExist,omitempty"`
	// Is true if a key matches regex KEY
	AKeyMatches string `json:"aKeyMatches,omitempty"`
	// Is true if no key matches regex KEY
	NoKeyMatches string `json:"noKeyMatches,omitempty"`
	// Is true if KEY exists and its value is VALUE
	KeyValueEquals map[string]string `json:"keyValueEquals,omitempty"`
	// Is true if KEY exists and its value is not VALUE
	KeyValueDoesNotEqual map[string]string `json:"keyValueDoesNotEqual,omitempty"`
	// Is true if key KEY exists and its value matches VALUE
	KeyValueMatches map[string]string `json:"keyValueMatches,omitempty"`
	// Is true if key KEY exists and its value does not match VALUE
	KeyValueDoesNotMatch map[string]string `json:"keyValueDoesNotMatch,omitempty"`
	// Is true if all keys matching KEY have values that match VALUE
	MatchingKeysHaveMatchingValues map[string]string `json:"matchingKeysHaveMatchingValues,omitempty"`
	// Is true if all keys matching KEY have values that do not match VALUE
	MatchingKeysDoNotHaveMatchingValues map[string]string `json:"matchingKeysDoNotHaveMatchingValues,omitempty"`
}

The plugin supports the following conditions

func (*Condition) DeepCopy

func (in *Condition) DeepCopy() *Condition

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition.

func (*Condition) DeepCopyInto

func (in *Condition) DeepCopyInto(out *Condition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Grep

type Grep struct {
	// Keep records which field matches the regular expression.
	// Value Format: FIELD REGEX
	Regex string `json:"regex,omitempty"`
	// Exclude records which field matches the regular expression.
	// Value Format: FIELD REGEX
	Exclude string `json:"exclude,omitempty"`
}

The Grep Filter plugin allows to match or exclude specific records based in regular expression patterns.

func (*Grep) DeepCopy

func (in *Grep) DeepCopy() *Grep

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Grep.

func (*Grep) DeepCopyInto

func (in *Grep) DeepCopyInto(out *Grep)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Grep) Name

func (_ *Grep) Name() string

func (*Grep) Params

func (g *Grep) Params(_ plugins.SecretLoader) (*params.KVs, error)

type Kubernetes

type Kubernetes struct {
	// Set the buffer size for HTTP client when reading responses from Kubernetes API server.
	// +kubebuilder:validation:Pattern:="^\\d+(k|K|KB|kb|m|M|MB|mb|g|G|GB|gb)?$"
	BufferSize string `json:"bufferSize,omitempty"`
	// API Server end-point
	KubeURL string `json:"kubeURL,omitempty"`
	// CA certificate file
	KubeCAFile string `json:"kubeCAFile,omitempty"`
	// Absolute path to scan for certificate files
	KubeCAPath string `json:"kubeCAPath,omitempty"`
	// Token file
	KubeTokenFile string `json:"kubeTokenFile,omitempty"`
	// When the source records comes from Tail input plugin,
	// this option allows to specify what's the prefix used in Tail configuration.
	KubeTagPrefix string `json:"kubeTagPrefix,omitempty"`
	// When enabled, it checks if the log field content is a JSON string map,
	// if so, it append the map fields as part of the log structure.
	MergeLog *bool `json:"mergeLog,omitempty"`
	// When Merge_Log is enabled, the filter tries to assume the log field from the incoming message is a JSON string message
	// and make a structured representation of it at the same level of the log field in the map.
	// Now if Merge_Log_Key is set (a string name), all the new structured fields taken from the original log content are inserted under the new key.
	MergeLogKey string `json:"mergeLogKey,omitempty"`
	// When Merge_Log is enabled, trim (remove possible \n or \r) field values.
	MergeLogTrim *bool `json:"mergeLogTrim,omitempty"`
	// Optional parser name to specify how to parse the data contained in the log key. Recommended use is for developers or testing only.
	MergeParser string `json:"mergeParser,omitempty"`
	// When Keep_Log is disabled, the log field is removed
	// from the incoming message once it has been successfully merged
	// (Merge_Log must be enabled as well).
	KeepLog *bool `json:"keepLog,omitempty"`
	// Debug level between 0 (nothing) and 4 (every detail).
	TLSDebug *int32 `json:"tlsDebug,omitempty"`
	// When enabled, turns on certificate validation when connecting to the Kubernetes API server.
	TLSVerify *bool `json:"tlsVerify,omitempty"`
	// When enabled, the filter reads logs coming in Journald format.
	UseJournal *bool `json:"useJournal,omitempty"`
	// Set an alternative Parser to process record Tag and extract pod_name, namespace_name, container_name and docker_id.
	// The parser must be registered in a parsers file (refer to parser filter-kube-test as an example).
	RegexParser string `json:"regexParser,omitempty"`
	// Allow Kubernetes Pods to suggest a pre-defined Parser
	// (read more about it in Kubernetes Annotations section)
	K8SLoggingParser *bool `json:"k8sLoggingParser,omitempty"`
	// Allow Kubernetes Pods to exclude their logs from the log processor
	// (read more about it in Kubernetes Annotations section).
	K8SLoggingExclude *bool `json:"k8sLoggingExclude,omitempty"`
	// Include Kubernetes resource labels in the extra metadata.
	Labels *bool `json:"labels,omitempty"`
	// Include Kubernetes resource annotations in the extra metadata.
	Annotations *bool `json:"annotations,omitempty"`
	// If set, Kubernetes meta-data can be cached/pre-loaded from files in JSON format in this directory,
	// named as namespace-pod.meta
	KubeMetaPreloadCacheDir string `json:"kubeMetaPreloadCacheDir,omitempty"`
	// If set, use dummy-meta data (for test/dev purposes)
	DummyMeta *bool `json:"dummyMeta,omitempty"`
}

Kubernetes filter allows to enrich your log files with Kubernetes metadata.

func (*Kubernetes) DeepCopy

func (in *Kubernetes) DeepCopy() *Kubernetes

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Kubernetes.

func (*Kubernetes) DeepCopyInto

func (in *Kubernetes) DeepCopyInto(out *Kubernetes)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Kubernetes) Name

func (_ *Kubernetes) Name() string

func (*Kubernetes) Params

func (k *Kubernetes) Params(_ plugins.SecretLoader) (*params.KVs, error)

type Lua

type Lua struct {
	// Path to the Lua script that will be used.
	Script v1.ConfigMapKeySelector `json:"script"`
	// Lua function name that will be triggered to do filtering.
	// It's assumed that the function is declared inside the Script defined above.
	Call string `json:"call"`
	// If these keys are matched, the fields are converted to integer.
	// If more than one key, delimit by space.
	// Note that starting from Fluent Bit v1.6 integer data types are preserved
	// and not converted to double as in previous versions.
	TypeIntKey []string `json:"typeIntKey,omitempty"`
	// If enabled, Lua script will be executed in protected mode.
	// It prevents to crash when invalid Lua script is executed. Default is true.
	ProtectedMode *bool `json:"protectedMode,omitempty"`
	// By default when the Lua script is invoked, the record timestamp is passed as a
	// Floating number which might lead to loss precision when the data is converted back.
	// If you desire timestamp precision enabling this option will pass the timestamp as
	// a Lua table with keys sec for seconds since epoch and nsec for nanoseconds.
	TimeAsTable bool `json:"timeAsTable,omitempty"`
}

The Lua Filter allows you to modify the incoming records using custom Lua Scripts.

func (*Lua) DeepCopy

func (in *Lua) DeepCopy() *Lua

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Lua.

func (*Lua) DeepCopyInto

func (in *Lua) DeepCopyInto(out *Lua)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Lua) Name

func (l *Lua) Name() string

func (*Lua) Params

func (l *Lua) Params(_ plugins.SecretLoader) (*params.KVs, error)

type Modify

type Modify struct {
	// All conditions have to be true for the rules to be applied.
	Conditions []Condition `json:"conditions,omitempty"`
	// Rules are applied in the order they appear,
	// with each rule operating on the result of the previous rule.
	Rules []Rule `json:"rules,omitempty"`
}

The Modify Filter plugin allows you to change records using rules and conditions.

func (*Modify) DeepCopy

func (in *Modify) DeepCopy() *Modify

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Modify.

func (*Modify) DeepCopyInto

func (in *Modify) DeepCopyInto(out *Modify)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Modify) Name

func (*Modify) Name() string

func (*Modify) Params

func (mo *Modify) Params(_ plugins.SecretLoader) (*params.KVs, error)

type Nest

type Nest struct {
	// Select the operation nest or lift
	// +kubebuilder:validation:Enum:=nest;lift
	Operation string `json:"operation,omitempty"`
	// Nest records which field matches the wildcard
	Wildcard []string `json:"wildcard,omitempty"`
	// Nest records matching the Wildcard under this key
	NestUnder string `json:"nestUnder,omitempty"`
	// Lift records nested under the Nested_under key
	NestedUnder string `json:"nestedUnder,omitempty"`
	// Prefix affected keys with this string
	AddPrefix string `json:"addPrefix,omitempty"`
	// Remove prefix from affected keys if it matches this string
	RemovePrefix string `json:"removePrefix,omitempty"`
}

The Nest Filter plugin allows you to operate on or with nested data. Its modes of operation are

func (*Nest) DeepCopy

func (in *Nest) DeepCopy() *Nest

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Nest.

func (*Nest) DeepCopyInto

func (in *Nest) DeepCopyInto(out *Nest)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Nest) Name

func (_ *Nest) Name() string

func (*Nest) Params

func (n *Nest) Params(_ plugins.SecretLoader) (*params.KVs, error)

type Parser

type Parser struct {
	// Specify field name in record to parse.
	KeyName string `json:"keyName,omitempty"`
	// Specify the parser name to interpret the field.
	// Multiple Parser entries are allowed (split by comma).
	Parser string `json:"parser,omitempty"`
	// Keep original Key_Name field in the parsed result.
	// If false, the field will be removed.
	PreserveKey *bool `json:"preserveKey,omitempty"`
	// Keep all other original fields in the parsed result.
	// If false, all other original fields will be removed.
	ReserveData *bool `json:"reserveData,omitempty"`
	// If the key is a escaped string (e.g: stringify JSON), unescape the string before to apply the parser.
	UnescapeKey *bool `json:"unescapeKey,omitempty"`
}

The Parser Filter plugin allows to parse field in event records.

func (*Parser) DeepCopy

func (in *Parser) DeepCopy() *Parser

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Parser.

func (*Parser) DeepCopyInto

func (in *Parser) DeepCopyInto(out *Parser)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Parser) Name

func (_ *Parser) Name() string

func (*Parser) Params

func (p *Parser) Params(_ plugins.SecretLoader) (*params.KVs, error)

type RecordModifier

type RecordModifier struct {
	// Append fields. This parameter needs key and value pair.
	Records []string `json:"records,omitempty"`
	// If the key is matched, that field is removed.
	RemoveKeys []string `json:"removeKeys,omitempty"`
	// If the key is not matched, that field is removed.
	WhitelistKeys []string `json:"whitelistKeys,omitempty"`
}

The Record Modifier Filter plugin allows to append fields or to exclude specific fields. RemoveKeys and WhitelistKeys are exclusive.

func (*RecordModifier) DeepCopy

func (in *RecordModifier) DeepCopy() *RecordModifier

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RecordModifier.

func (*RecordModifier) DeepCopyInto

func (in *RecordModifier) DeepCopyInto(out *RecordModifier)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RecordModifier) Name

func (_ *RecordModifier) Name() string

func (*RecordModifier) Params

func (rm *RecordModifier) Params(_ plugins.SecretLoader) (*params.KVs, error)

type RewriteTag

type RewriteTag struct {
	// Defines the matching criteria and the format of the Tag for the matching record.
	// The Rule format have four components: KEY REGEX NEW_TAG KEEP.
	Rules []string `json:"rules,omitempty"`
	// When the filter emits a record under the new Tag, there is an internal emitter
	// plugin that takes care of the job. Since this emitter expose metrics as any other
	// component of the pipeline, you can use this property to configure an optional name for it.
	EmitterName string `json:"emitterName,omitempty"`
	// Define a buffering mechanism for the new records created.
	// Note these records are part of the emitter plugin. This option support the values
	// "memory" (default) or "filesystem".
	EmitterStorageType string `json:"emitterStorageType,omitempty"`
	// Set a limit on the amount of memory the tag rewrite emitter can consume
	// if the outputs provide backpressure.
	EmitterMemoryBufferLimit string `json:"emitterMemoryBufferLimit,omitempty"`
}

RewriteTag define a `rewrite_tag` filter, allows to re-emit a record under a new Tag. Once a record has been re-emitted, the original record can be preserved or discarded.

func (*RewriteTag) DeepCopy

func (in *RewriteTag) DeepCopy() *RewriteTag

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RewriteTag.

func (*RewriteTag) DeepCopyInto

func (in *RewriteTag) DeepCopyInto(out *RewriteTag)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RewriteTag) Name

func (_ *RewriteTag) Name() string

func (*RewriteTag) Params

func (r *RewriteTag) Params(_ plugins.SecretLoader) (*params.KVs, error)

type Rule

type Rule struct {
	// Add a key/value pair with key KEY and value VALUE. If KEY already exists, this field is overwritten
	Set map[string]string `json:"set,omitempty"`
	// Add a key/value pair with key KEY and value VALUE if KEY does not exist
	Add map[string]string `json:"add,omitempty"`
	// Remove a key/value pair with key KEY if it exists
	Remove string `json:"remove,omitempty"`
	// Remove all key/value pairs with key matching wildcard KEY
	RemoveWildcard string `json:"removeWildcard,omitempty"`
	// Remove all key/value pairs with key matching regexp KEY
	RemoveRegex string `json:"removeRegex,omitempty"`
	// Rename a key/value pair with key KEY to RENAMED_KEY if KEY exists AND RENAMED_KEY does not exist
	Rename map[string]string `json:"rename,omitempty"`
	// Rename a key/value pair with key KEY to RENAMED_KEY if KEY exists.
	// If RENAMED_KEY already exists, this field is overwritten
	HardRename map[string]string `json:"hardRename,omitempty"`
	// Copy a key/value pair with key KEY to COPIED_KEY if KEY exists AND COPIED_KEY does not exist
	Copy map[string]string `json:"copy,omitempty"`
	// Copy a key/value pair with key KEY to COPIED_KEY if KEY exists.
	// If COPIED_KEY already exists, this field is overwritten
	HardCopy map[string]string `json:"hardCopy,omitempty"`
}

The plugin supports the following rules

func (*Rule) DeepCopy

func (in *Rule) DeepCopy() *Rule

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Rule.

func (*Rule) DeepCopyInto

func (in *Rule) DeepCopyInto(out *Rule)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Throttle

type Throttle struct {
	// Rate is the amount of messages for the time.
	Rate *int64 `json:"rate,omitempty"`
	// Window is the amount of intervals to calculate average over.
	Window *int64 `json:"window,omitempty"`
	// Interval is the time interval expressed in "sleep" format. e.g. 3s, 1.5m, 0.5h, etc.
	// +kubebuilder:validation:Pattern:="^\\d+(\\.[0-9]{0,2})?(s|m|h|d)?$"
	Interval string `json:"interval,omitempty"`
	// PrintStatus represents whether to print status messages with current rate and the limits to information logs.
	PrintStatus *bool `json:"printStatus,omitempty"`
}

Throttle filter allows you to set the average rate of messages per internal, based on leaky bucket and sliding window algorithm.

func (*Throttle) DeepCopy

func (in *Throttle) DeepCopy() *Throttle

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Throttle.

func (*Throttle) DeepCopyInto

func (in *Throttle) DeepCopyInto(out *Throttle)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Throttle) Name

func (*Throttle) Name() string

Name is the name of the filter plugin.

func (*Throttle) Params

func (k *Throttle) Params(_ plugins.SecretLoader) (*params.KVs, error)

Params represents the config options for the filter plugin.

Jump to

Keyboard shortcuts

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