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 ClientConfig ¶ added in v0.35.0
type ClientConfig struct { // GrafanaLokiConfig holds the configuration for the grafana/loki client GrafanaLokiConfig client.Config // BufferConfig holds the configuration for the buffered client BufferConfig BufferConfig // SortByTimestamp indicates whether the logs should be sorted ot not SortByTimestamp bool // NumberOfBatchIDs is number of id per batch. // This increase the number of loki label streams NumberOfBatchIDs uint64 }
ClientConfig holds configuration for the clients
type Config ¶
type Config struct { ClientConfig ClientConfig ControllerConfig ControllerConfig PluginConfig PluginConfig LogLevel logging.Level Pprof bool }
Config holds all of the needet properties of the loki output plugin
func ParseConfig ¶
ParseConfig parse a Loki plugin configuration
type ControllerConfig ¶ added in v0.35.0
type ControllerConfig struct { // CtlSyncTimeout for resource synchronization CtlSyncTimeout time.Duration // DynamicHostPrefix is the prefix of the dynamic host endpoint DynamicHostPrefix string // DynamicHostSuffix is the suffix of the dynamic host endpoint DynamicHostSuffix string // SendDeletedClustersLogsToDefaultClient indicates whether the logs from // shoot in deleting state should be save in the default url or not SendDeletedClustersLogsToDefaultClient bool // DeletedClientTimeExpiration is the time after a client for // deleted shoot should be cosidered for removal DeletedClientTimeExpiration time.Duration // CleanExpiredClientsPeriod is the period of deletion of expired clients CleanExpiredClientsPeriod time.Duration }
ControllerConfig hold the configuration fot the Loki client controller
type DqueConfig ¶
DqueConfig contains the dqueue settings
type DynamicTenant ¶ added in v0.36.0
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
type PluginConfig ¶ added in v0.35.0
type PluginConfig struct { // AutoKubernetesLabels extact all key/values from the kubernetes field AutoKubernetesLabels bool // RemoveKeys specify removing keys RemoveKeys []string // LabelKeys is comma separated list of keys to use as stream labels LabelKeys []string // LineFormat is the format to use when flattening the record to a log line LineFormat Format // DropSingleKey if set to true and after extracting label_keys a record only // has a single key remaining, the log line sent to Loki will just be // the value of the record key DropSingleKey bool // LabelMap is path to a json file defining how to transform nested records LabelMap map[string]interface{} // DynamicHostPath is jsonpath in the log labels to the dynamic host DynamicHostPath map[string]interface{} // DynamicHostRegex is regex to check if the dynamic host is valid DynamicHostRegex string // KubernetesMetadata holds the configurations for retrieving the meta data from a tag KubernetesMetadata KubernetesMetadataExtraction DynamicTenant DynamicTenant }
PluginConfig contains the configuration mostly related to the Loki plugin
Click to show internal directories.
Click to hide internal directories.