config

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// JSONFormat represents json format for log line
	JSONFormat Format = iota
	// KvPairFormat represents key-value format for log line
	KvPairFormat
	// DefaultKubernetesMetadataTagExpression for extracting the kubernetes metadata from tag
	DefaultKubernetesMetadataTagExpression = "\\.([^_]+)_([^_]+)_(.+)-([a-z0-9]{64})\\.log$"

	// DefaultKubernetesMetadataTagKey represents the key for the tag in the entry
	DefaultKubernetesMetadataTagKey = "tag"

	// DefaultKubernetesMetadataTagPrefix represents the prefix of the entry's tag
	DefaultKubernetesMetadataTagPrefix = "kubernetes\\.var\\.log\\.containers"
)

Variables

View Source
var DefaultBufferConfig = BufferConfig{
	Buffer:     false,
	BufferType: "dque",
	DqueConfig: DefaultDqueConfig,
}

DefaultBufferConfig holds the configurations for using output buffer

View Source
var DefaultDqueConfig = DqueConfig{
	QueueDir:         "/tmp/flb-storage/loki",
	QueueSegmentSize: 500,
	QueueSync:        false,
	QueueName:        "dque",
}

DefaultDqueConfig holds dque configurations for the buffer

Functions

This section is empty.

Types

type BufferConfig

type BufferConfig struct {
	Buffer     bool
	BufferType string
	DqueConfig DqueConfig
}

BufferConfig contains the buffer settings

type Config

type Config struct {
	ClientConfig         client.Config
	BufferConfig         BufferConfig
	LogLevel             logging.Level
	CtlSyncTimeout       time.Duration
	AutoKubernetesLabels bool
	SortByTimestamp      bool
	NumberOfBatchIDs     uint64
	RemoveKeys           []string
	LabelKeys            []string
	LineFormat           Format
	DropSingleKey        bool
	LabelMap             map[string]interface{}
	DynamicHostPath      map[string]interface{}
	DynamicHostPrefix    string
	DynamicHostSuffix    string
	DynamicHostRegex     string
	KubernetesMetadata   KubernetesMetadataExtraction
}

Config holds all of the needet properties of the loki output plugin

func ParseConfig

func ParseConfig(cfg Getter) (*Config, error)

ParseConfig parse a Loki plugin configuration

type DqueConfig

type DqueConfig struct {
	QueueDir         string
	QueueSegmentSize int
	QueueSync        bool
	QueueName        string
}

DqueConfig contains the dqueue settings

type Format

type Format int

Format is the log line format

type Getter

type Getter interface {
	Get(key string) string
}

Getter get a configuration settings base on the passed key

type KubernetesMetadataExtraction

type KubernetesMetadataExtraction struct {
	FallbackToTagWhenMetadataIsMissing bool
	DropLogEntryWithoutK8sMetadata     bool
	TagKey                             string
	TagPrefix                          string
	TagExpression                      string
}

KubernetesMetadataExtraction holds the configurations for retrieving the meta data from a tag

Jump to

Keyboard shortcuts

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