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 ¶
- func CustomUserAgentHandler() request.NamedHandler
- func DataKeys(input string, record map[interface{}]interface{}) map[interface{}]interface{}
- func DecodeMap(record map[interface{}]interface{}) (map[interface{}]interface{}, error)
- func EncodeLogKey(log *interface{}) ([]byte, error)
- func GetBoolParam(param string, defaultVal bool) bool
- func LogKey(record map[interface{}]interface{}, logKey string) (*interface{}, error)
- func SetupLogger()
- type Timeout
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
EncodeLogKey prepares a record to be sent when the log_key parameter is used
func GetBoolParam ¶ added in v1.6.0
GetBoolParam is used for boolean config setup
func LogKey ¶ added in v1.3.0
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 ¶
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)