exec

package
v1.17.0 Latest Latest
Warning

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

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

README

Exec Lookup Plugin

The exec lookup executes a configured command with its arguments and stores the result as lookup data. This plugin requires a parser, and only the first parsed event is used.

Configuration

[[lookups]]
  [lookups.exec]
    alias = "token.renew"

    # command to execute
    command = "kubectl"

    # command args, strings list
    args = []

    # command stdin
    stdin = ""

    # command working directory
    dir = ""

    # exec timeout
    timeout = "10s"

    # lookup update interval
    # if zero, plugin executes command only on pipeline startup
    interval = "30s"

    # command envs (os.Environ() already included)
    # each configured will be added to the environment 
    # of the process in the "env_name=env_value" form
    [lookups.exec.envs]
      CATCH_PHRASE = "phrase"

    [lookups.exec.parser]
      type = "json"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exec

type Exec struct {
	*core.BaseLookup `mapstructure:"-"`
	Command          string            `mapstructure:"command"`
	Args             []string          `mapstructure:"args"`
	Stdin            string            `mapstructure:"stdin"`
	Dir              string            `mapstructure:"dir"`
	Timeout          time.Duration     `mapstructure:"timeout"`
	Envs             map[string]string `mapstructure:"envs"`
	// contains filtered or unexported fields
}

func (*Exec) Close

func (l *Exec) Close() error

func (*Exec) Init

func (l *Exec) Init() error

func (*Exec) SetParser

func (l *Exec) SetParser(p core.Parser)

func (*Exec) Update

func (l *Exec) Update() (any, error)

Jump to

Keyboard shortcuts

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