Documentation
¶
Index ¶
- Variables
- func MapLabelPaths(labels []string, f func([]string) string) ([]string, error)
- func MatchMustacheGroup(s string) (string, bool)
- func MatchMustachePath(s string) (string, bool)
- func ParseLabelPath(path string) ([]string, error)
- func PathSegmentsToVRLArray(segments []string) string
- func PathSegmentsToVRLDotPath(segments []string) string
- func SinkKeysFromVRLPaths(paths []string) ([]string, error)
- func VRLRegexFindComparisonOp(op WhenOp) (string, error)
- func ValidateWhenRegexExpr(we *WhenExpr) error
- type WhenExpr
- type WhenOp
Constants ¶
This section is empty.
Variables ¶
var ErrWhenExactlyOneOperator = errors.New("when: exactly one operator is allowed; quote the value if it must contain operator characters")
Functions ¶
func MapLabelPaths ¶
MapLabelPaths parses each dot-prefixed label path and applies f to the segments slice.
func MatchMustacheGroup ¶
MatchMustacheGroup extracts a regex capture group name from a mustache template. example: `{{ grp }}` → ("grp", true) example: `literal` → ("", false)
func MatchMustachePath ¶
MatchMustachePath extracts the inner path from a mustache template. example: `{{ .foo.bar }}` → (".foo.bar", true) example: `plain` → ("", false)
func ParseLabelPath ¶
ParseLabelPath splits a dot-prefixed label path into segments. example: `.foo.bar` → ["foo", "bar"] example: `.msg."a-b".level` → ["msg", "a-b", "level"] example: `.k."a\"b"` → ["k", `a"b`]
func PathSegmentsToVRLArray ¶
PathSegmentsToVRLArray formats segments as a VRL array literal.
func PathSegmentsToVRLDotPath ¶
PathSegmentsToVRLDotPath formats segments as a VRL dot-notation path. Bare identifiers stay unquoted, special characters get quoted. example: ["foo", "bar"] → `.foo.bar` example: ["msg", "a-b"] → `.msg."a-b"`
func SinkKeysFromVRLPaths ¶
SinkKeysFromVRLPaths returns each path as a VRL dot path without the leading dot (for loglabels drop prefixes; same rule as addLabels sink keys).
func VRLRegexFindComparisonOp ¶
VRLRegexFindComparisonOp maps =~ / !=~ to the equality operator used in generated VRL for regex match vs non-match on the extracted string.
func ValidateWhenRegexExpr ¶
ValidateWhenRegexExpr compiles WhenExpr.Value for =~ / !=~. Invalid patterns must be rejected when building config so Vector does not fail at runtime.