relabel

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config []*Rule

Config is a collection of rules for updating the labels on a message.

func (Config) Relabel

func (rlc Config) Relabel(m *logspray.Message) bool

Relabel transforms the labels on message m using the set of relabel rules.

type JSONRegexp

type JSONRegexp struct {
	*regexp.Regexp
}

JSONRegexp provides a means of directly unmarshaling a regexp

func (*JSONRegexp) MarshalJSON

func (r *JSONRegexp) MarshalJSON() ([]byte, error)

MarshalJSON implements the yaml Marshaler interface for JSON Regex

func (*JSONRegexp) MarshalYAML

func (r *JSONRegexp) MarshalYAML() (interface{}, error)

MarshalYAML implements the yaml Marshaler interface for JSON Regex

func (*JSONRegexp) UnmarshalJSON

func (r *JSONRegexp) UnmarshalJSON(bs []byte) error

UnmarshalJSON implements the yaml Unmarshaler interface for JSON Regex

func (*JSONRegexp) UnmarshalYAML

func (r *JSONRegexp) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml Unmarshaler interface for JSON Regex

type Rule

type Rule struct {
	Action      ruleFunc    `json:"action" yaml:"action"`
	SrcLabels   []string    `json:"source_labels" yaml:"source_labels"`
	TargetLabel string      `json:"target_label" yaml:"target_label"`
	Regex       *JSONRegexp `json:"regex" yaml:"regex"`
	Replacement string      `json:"replacement" yaml:"replacement"`
	Separator   string      `json:"separator" yaml:"separator"`
	XXX         `json:",omitempty" yaml:",omitempty,inline"`
}

Rule describes configuraiton for a rule to relabel a message.

func (*Rule) Relabel

func (r *Rule) Relabel(m *logspray.Message) bool

Relabel the provided message using the described rule.

func (*Rule) UnmarshalJSON

func (r *Rule) UnmarshalJSON(bs []byte) error

UnmarshalJSON unmarshals yaml to a Relabel rule with appropriate defaults

func (*Rule) UnmarshalYAML

func (r *Rule) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML unmarshals yaml to a Relabel rule with appropriate defaults

type XXX

type XXX map[string]interface{}

XXX catches unknown Rule settings

Jump to

Keyboard shortcuts

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