input

package
v3.0.0-...-cc23366 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Forward

type Forward struct {
	// The transport section of forward plugin
	Transport *common.Transport `json:"transport,omitempty"`
	// The security section of forward plugin
	Security *common.Security `json:"security,omitempty"`
	// The security section of client plugin
	Client *common.Client `json:"client,omitempty"`
	// The security section of user plugin
	User *common.User `json:"user,omitempty"`
	// The port to listen to, default is 24224.
	// +kubebuilder:validation:Minimum:=1
	// +kubebuilder:validation:Maximum:=65535
	Port *int32 `json:"port,omitempty"`
	// The port to listen to, default is "0.0.0.0"
	Bind *string `json:"bind,omitempty"`
	// in_forward uses incoming event's tag by default (See Protocol Section).
	// If the tag parameter is set, its value is used instead.
	Tag *string `json:"tag,omitempty"`
	// Adds the prefix to the incoming event's tag.
	AddTagPrefix *string `json:"addTagPrefix,omitempty"`
	// The timeout used to set the linger option.
	LingerTimeout *uint16 `json:"lingerTimeout,omitempty"`
	// Tries to resolve hostname from IP addresses or not.
	ResolveHostname *bool `json:"resolveHostname,omitempty"`
	// The connections will be disconnected right after receiving a message, if true.
	DenyKeepalive *bool `json:"denyKeepalive,omitempty"`
	// Enables the TCP keepalive for sockets.
	SendKeepalivePacket *bool `json:"sendKeepalivePacket,omitempty"`
	// The size limit of the received chunk. If the chunk size is larger than this value, the received chunk is dropped.
	// +kubebuilder:validation:Pattern:="^\\d+(KB|MB|GB|TB)$"
	ChunkSizeLimit *string `json:"chunkSizeLimit,omitempty"`
	// The warning size limit of the received chunk. If the chunk size is larger than this value, a warning message will be sent.
	// +kubebuilder:validation:Pattern:="^\\d+(KB|MB|GB|TB)$"
	ChunkSizeWarnLimit *string `json:"chunkSizeWarnLimit,omitempty"`
	// Skips the invalid incoming event.
	SkipInvalidEvent *bool `json:"skipInvalidEvent,omitempty"`
	// The field name of the client's source address. If set, the client's address will be set to its key.
	SourceAddressKey *string `json:"sourceAddressKey,omitempty"`
	// The field name of the client's hostname. If set, the client's hostname will be set to its key.
	SourceHostnameKey *string `json:"sourceHostnameKey,omitempty"`
}

Forward defines the in_forward Input plugin that listens to a TCP socket to receive the event stream.

type Group

type Group struct {
	// Specifies the regular expression for extracting metadata (namespace, podname) from log file path.
	// Default value of the pattern regexp extracts information about namespace, podname, docker_id, container of the log (K8s specific).
	Pattern string `json:"pattern,omitempty"`
	// Time period in which the group line limit is applied. in_tail resets the counter after every rate_period interval.
	RatePeriod *int32 `json:"ratePeriod,omitempty"`
	// Grouping rules for log files.
	// +kubebuilder:validation:Required
	Rule *Rule `json:"rule"`
}

func (*Group) Name

func (g *Group) Name() string

func (*Group) Params

func (g *Group) Params(loader plugins.SecretLoader) (*params.PluginStore, error)

type Http

type Http struct {
	// The transport section of http plugin
	Transport *common.Transport `json:"transport,omitempty"`
	// The parse section of http plugin
	Parse *common.Parse `json:"parse,omitempty"`
	// The port to listen to, default is 9880.
	// +kubebuilder:validation:Minimum:=1
	// +kubebuilder:validation:Maximum:=65535
	Port *int32 `json:"port,omitempty"`
	// The port to listen to, default is "0.0.0.0"
	Bind *string `json:"bind,omitempty"`
	// The size limit of the POSTed element.
	// +kubebuilder:validation:Pattern:="^\\d+(KB|MB|GB|TB)$"
	BodySizeLimit *string `json:"bodySizeLimit,omitempty"`
	// The timeout limit for keeping the connection alive.
	// +kubebuilder:validation:Pattern:="^\\d+(\\.[0-9]{0,2})?(s|m|h|d)?$"
	KeepLiveTimeout *string `json:"keepaliveTimeout,omitempty"`
	// Adds HTTP_ prefix headers to the record.
	AddHttpHeaders *bool `json:"addHttpHeaders,omitempty"`
	// Adds REMOTE_ADDR field to the record. The value of REMOTE_ADDR is the client's address.
	// i.e: X-Forwarded-For: host1, host2
	AddRemoteAddr *string `json:"addRemoteAddr,omitempty"`
	// Whitelist domains for CORS.
	CorsAllowOrigins *string `json:"corsAllOrigins,omitempty"`
	// Add Access-Control-Allow-Credentials header. It's needed when a request's credentials mode is include
	CorsAllowCredentials *string `json:"corsAllowCredentials,omitempty"`
	// Responds with an empty GIF image of 1x1 pixel (rather than an empty string).
	RespondsWithEmptyImg *bool `json:"respondsWithEmptyImg,omitempty"`
}

Http defines the in_http Input plugin that listens to a TCP socket to receive the event stream.

type Input

type Input struct {
	InputCommon `json:",inline"`
	// in_forward plugin
	Forward *Forward `json:"forward,omitempty"`
	// in_http plugin
	Http *Http `json:"http,omitempty"`
	// in_tail plugin
	Tail *Tail `json:"tail,omitempty"`
	// in_sample plugin
	Sample *Sample `json:"sample,omitempty"`
	// Custom plugin type
	CustomPlugin *custom.CustomPlugin `json:"customPlugin,omitempty"`
	// monitor_agent plugin
	MonitorAgent *MonitorAgent `json:"monitorAgent,omitempty"`
}

Input defines all available input plugins and their parameters

func (*Input) DeepCopyInto

func (in *Input) DeepCopyInto(out *Input)

DeepCopyInto implements the DeepCopyInto interface.

func (*Input) Name

func (i *Input) Name() string

func (*Input) Params

func (i *Input) Params(loader plugins.SecretLoader) (*params.PluginStore, error)

type InputCommon

type InputCommon struct {
	// The @id parameter specifies a unique name for the configuration.
	Id *string `json:"id,omitempty"`
	// The @log_level parameter specifies the plugin-specific logging level
	LogLevel *string `json:"logLevel,omitempty"`
	// The @label parameter is to route the input events to <label> sections.
	Label *string `json:"label,omitempty"`
}

InputCommon defines the common parameters for input plugins

type MonitorAgent

type MonitorAgent struct {
	// The port to listen to.
	Port *int64 `json:"port,omitempty"`
	// The bind address to listen to.
	Bind *string `json:"bind,omitempty"`
	// If you set this parameter, this plugin emits metrics as records.
	Tag *string `json:"tag,omitempty"`
	// The interval time between event emits. This will be used when "tag" is configured.
	EmitInterval *int64 `json:"emitInterval,omitempty"`
	// You can set this option to false to remove the config field from the response.
	IncludeConfig *bool `json:"includeConfig,omitempty"`
	// You can set this option to false to remove the retry field from the response.
	IncludeRetry *bool `json:"includeRetry,omitempty"`
}

The in_monitor_agent Input plugin exports Fluentd's internal metrics via REST API.

type Rule

type Rule struct {
	// match parameter is used to check if a file belongs to a particular group based on hash keys (named captures from pattern) and hash values (regexp in string)
	Match map[string]string `json:"match,omitempty"`
	// Maximum number of lines allowed from a group in rate_period time interval. The default value of -1 doesn't throttle log files of that group.
	Limit *int32 `json:"limit,omitempty"`
}

func (*Rule) Name

func (r *Rule) Name() string

func (*Rule) Params

func (r *Rule) Params(_ plugins.SecretLoader) (*params.PluginStore, error)

type Sample

type Sample struct {
	// The tag of the event. The value is the tag assigned to the generated events.
	Tag *string `json:"tag,omitempty"`
	// The number of events in the event stream of each emit.
	Size *int64 `json:"size,omitempty"`
	// It configures how many events to generate per second.
	Rate *int64 `json:"rate,omitempty"`
	// If specified, each generated event has an auto-incremented key field.
	AutoIncrementKey *string `json:"autoIncrementKey,omitempty"`
	// The sample data to be generated. It should be either an array of JSON hashes or a single JSON hash. If it is an array of JSON hashes, the hashes in the array are cycled through in order.
	Sample *string `json:"sample,omitempty"`
}

The in_sample input plugin generates sample events. It is useful for testing, debugging, benchmarking and getting started with Fluentd.

type Tail

type Tail struct {
	// +kubebuilder:validation:Required
	// The tag of the event.
	Tag string `json:"tag"`
	// +kubebuilder:validation:Required
	// The path(s) to read. Multiple paths can be specified, separated by comma ','.
	Path string `json:"path"`
	// This parameter is for strftime formatted path like /path/to/%Y/%m/%d/.
	PathTimezone string `json:"pathTimezone,omitempty"`
	// The paths excluded from the watcher list.
	ExcludePath []string `json:"excludePath,omitempty"`
	// Avoid to read rotated files duplicately. You should set true when you use * or strftime format in path.
	FollowInodes *bool `json:"followInodes,omitempty"`
	// The interval to refresh the list of watch files. This is used when the path includes *.
	RefreshInterval *uint32 `json:"refreshInterval,omitempty"`
	// Limits the watching files that the modification time is within the specified time range when using * in path.
	LimitRecentlyModified *uint32 `json:"limitRecentlyModified,omitempty"`
	// Skips the refresh of the watch list on startup. This reduces the startup time when * is used in path.
	SkipRefreshOnStartup *bool `json:"skipRefreshOnStartup,omitempty"`
	// Starts to read the logs from the head of the file or the last read position recorded in pos_file, not tail.
	ReadFromHead *bool `json:"readFromHead,omitempty"`
	// Specifies the encoding of reading lines. By default, in_tail emits string value as ASCII-8BIT encoding.
	// If encoding is specified, in_tail changes string to encoding.
	// If encoding and fromEncoding both are specified, in_tail tries to encode string from fromEncoding to encoding.
	Encoding string `json:"encoding,omitempty"`
	// Specifies the encoding of reading lines. By default, in_tail emits string value as ASCII-8BIT encoding.
	// If encoding is specified, in_tail changes string to encoding.
	// If encoding and fromEncoding both are specified, in_tail tries to encode string from fromEncoding to encoding.
	FromEncoding string `json:"fromEncoding,omitempty"`
	// The number of lines to read with each I/O operation.
	ReadLinesLimit *int32 `json:"readLinesLimit,omitempty"`
	// The number of reading bytes per second to read with I/O operation. This value should be equal or greater than 8192.
	ReadBytesLimitPerSecond *int32 `json:"readBytesLimitPerSecond,omitempty"`
	// The maximum length of a line. Longer lines than it will be just skipped.
	MaxLineSize *int32 `json:"maxLineSize,omitempty"`
	// The interval of flushing the buffer for multiline format.
	MultilineFlushInterval *uint32 `json:"multilineFlushInterval,omitempty"`
	// (recommended) Fluentd will record the position it last read from this file.
	// pos_file handles multiple positions in one file so no need to have multiple pos_file parameters per source.
	// Don't share pos_file between in_tail configurations. It causes unexpected behavior e.g. corrupt pos_file content.
	PosFile string `json:"posFile,omitempty"`
	// The interval of doing compaction of pos file.
	PosFileCompactionInterval *uint32 `json:"posFileCompactionInterval,omitempty"`
	// +kubebuilder:validation:Required
	Parse *common.Parse `json:"parse"`
	// Adds the watching file path to the path_key field.
	PathKey string `json:"pathKey,omitempty"`
	// in_tail actually does a bit more than tail -F itself. When rotating a file, some data may still need to be written to the old file as opposed to the new one.
	// in_tail takes care of this by keeping a reference to the old file (even after it has been rotated) for some time before transitioning completely to the new file.
	// This helps prevent data designated for the old file from getting lost. By default, this time interval is 5 seconds.
	// The rotate_wait parameter accepts a single integer representing the number of seconds you want this time interval to be.
	RotateWait *uint32 `json:"rotateWait,omitempty"`
	// Enables the additional watch timer. Setting this parameter to false will significantly reduce CPU and I/O consumption when tailing a large number of files on systems with inotify support.
	// The default is true which results in an additional 1 second timer being used.
	EnableWatchTimer *bool `json:"enableWatchTimer,omitempty"`
	// Enables the additional inotify-based watcher. Setting this parameter to false will disable the inotify events and use only timer watcher for file tailing.
	// This option is mainly for avoiding the stuck issue with inotify.
	EnableStatWatcher *bool `json:"enableStatWatcher,omitempty"`
	// Opens and closes the file on every update instead of leaving it open until it gets rotated.
	OpenOnEveryUpdate *bool `json:"openOnEveryUpdate,omitempty"`
	// Emits unmatched lines when <parse> format is not matched for incoming logs.
	EmitUnmatchedLines *bool `json:"emitUnmatchedLines,omitempty"`
	// If you have to exclude the non-permission files from the watch list, set this parameter to true. It suppresses the repeated permission error logs.
	IgnoreRepatedPermissionError *bool `json:"ignoreRepeatedPermissionError,omitempty"`
	// The in_tail plugin can assign each log file to a group, based on user defined rules.
	// The limit parameter controls the total number of lines collected for a group within a rate_period time interval.
	Group *Group `json:"group,omitempty"`
}

The in_tail Input plugin allows Fluentd to read events from the tail of text files. Its behavior is similar to the tail -F command.

Jump to

Keyboard shortcuts

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