plugins

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2023 License: Apache-2.0 Imports: 9 Imported by: 7

Documentation

Overview

Package plugins contains functions that are useful across fluent bit plugins. This package will be imported by the CloudWatch Logs and Kinesis Data Streams plugins.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CustomUserAgentHandler

func CustomUserAgentHandler() request.NamedHandler

CustomUserAgentHandler returns a http request handler that sets a custom user agent to all aws requests

func DataKeys

func DataKeys(input string, record map[interface{}]interface{}) map[interface{}]interface{}

DataKeys allows users to specify a list of keys in the record which they want to be sent all others are discarded

func DecodeMap

func DecodeMap(record map[interface{}]interface{}) (map[interface{}]interface{}, error)

DecodeMap prepares a record for JSON marshalling Any []byte will be base64 encoded when marshaled to JSON, so we must directly cast all []byte to string

func EncodeLogKey added in v1.3.0

func EncodeLogKey(log *interface{}) ([]byte, error)

EncodeLogKey prepares a record to be sent when the log_key parameter is used

func GetBoolParam added in v1.6.0

func GetBoolParam(param string, defaultVal bool) bool

GetBoolParam is used for boolean config setup

func LogKey added in v1.3.0

func LogKey(record map[interface{}]interface{}, logKey string) (*interface{}, error)

LogKey returns the value associated with the input key from the record map, or an error if the key is not found.

func SetupLogger

func SetupLogger()

SetupLogger sets up Logrus with the log level determined by the Fluent Bit Env Var

Types

type Timeout

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

Timeout is a simple timeout for single-threaded programming (Goroutines are expensive in Cgo)

func NewTimeout

func NewTimeout(timeoutFunc func(duration time.Duration)) (*Timeout, error)

NewTimeout returns a new timeout object with a duration set from the env var if the env var is not set, then a timer is returned that is disabled (it doesn't do anything)

func (*Timeout) Check

func (t *Timeout) Check()

Check the timer to see if its timed out

func (*Timeout) Reset

func (t *Timeout) Reset()

Reset the timer

func (*Timeout) Start

func (t *Timeout) Start()

Start the timer this method has no effect if the timer has already been started

Jump to

Keyboard shortcuts

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