utils

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: Apache-2.0 Imports: 7 Imported by: 22

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeDot

func DeDot(s string) string

DeDot a string by replacing all . with _ This helps when sending data to Elasticsearch to prevent object and key collisions.

func GenerateHints added in v0.2.1

func GenerateHints(annotations mapstr.M, container, prefix string) mapstr.M

GenerateHints parses annotations based on a prefix and sets up hints that can be picked up by individual Beats.

func GetConfigs added in v0.2.1

func GetConfigs(hints mapstr.M, key, name string) []mapstr.M

GetConfigs takes in a key and returns a list of configs as a slice of MapStr

func GetContainerID added in v0.2.1

func GetContainerID(container mapstr.M) string

GetContainerID returns the id of a container

func GetContainerName added in v0.2.1

func GetContainerName(container mapstr.M) string

GetContainerName returns the name of a container

func GetHintAsConfigs added in v0.2.1

func GetHintAsConfigs(hints mapstr.M, key string) []mapstr.M

GetHintAsConfigs can read a hint in the form of a stringified JSON and return a mapstr.M

func GetHintAsList added in v0.2.1

func GetHintAsList(hints mapstr.M, key, config string) []string

GetHintAsList takes a hint and returns the value as lists.

func GetHintMapStr added in v0.2.1

func GetHintMapStr(hints mapstr.M, key, config string) mapstr.M

GetHintMapStr takes a hint and returns a MapStr

func GetHintString added in v0.2.1

func GetHintString(hints mapstr.M, key, config string) string

GetHintString takes a hint and returns its value as a string

func GetHintsAsList added in v0.2.1

func GetHintsAsList(hints mapstr.M, key string) []mapstr.M

GetHintsAsList gets a set of hints and tries to convert them into a list of hints

func GetProcessors added in v0.2.1

func GetProcessors(hints mapstr.M, key string) []mapstr.M

GetProcessors gets processor definitions from the hints and returns a list of configs as a MapStr

func IsDisabled added in v0.2.1

func IsDisabled(hints mapstr.M, key string) bool

IsDisabled will return true when 'enabled' is **explicitly** set to false.

func IsEnabled added in v0.2.1

func IsEnabled(hints mapstr.M, key string) bool

IsEnabled will return true when 'enabled' is **explicitly** set to true.

Types

This section is empty.

Jump to

Keyboard shortcuts

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