dynamic_template

package
v1.16.2 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

README

Dynamic Template Processor Plugin

The dynamic_template processor evaluates Golang templates in configured labels and fields. Slim-sprig functions available!

Unlike template processor, this plugin does not use predefined templates. Instead, it uses label or field content as a template and replaces it by execution result.

Plugin uses wrapped events.

If template execution fails, event is marked as failed, but other templates execution continues.

[!TIP]
This plugin may write it's own metrics

Configuration

[[processors]]
  [processors.dynamic_template]
    # if true, plugin metrics cache length exposed as metric
    enable_metrics = false

    # compiled template TTL
    template_ttl = "1h"

    # list of labels to evaluate
    labels = [ "hello_message" ]

    # list of fields to evaluate
    # field must be a string or a slice/map of strings
    fields = [ "annotations" ]

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DynamicTemplate

type DynamicTemplate struct {
	*core.BaseProcessor `mapstructure:"-"`
	EnableMetrics       bool          `mapstructure:"enable_metrics"`
	TemplateTTL         time.Duration `mapstructure:"template_ttl"`
	Labels              []string      `mapstructure:"labels"`
	Fields              []string      `mapstructure:"fields"`
	// contains filtered or unexported fields
}

func (*DynamicTemplate) Close

func (p *DynamicTemplate) Close() error

func (*DynamicTemplate) Init

func (p *DynamicTemplate) Init() error

func (*DynamicTemplate) Run

func (p *DynamicTemplate) Run()

Jump to

Keyboard shortcuts

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