starlark

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

README

Starlark Processor Plugin

The starlark processor uses a Starlark script to process events.

The Starlark script must have a process function that accepts an event and returns an event, events list, error or None. If function does not exists it is a compilation error, if it have other signature, it is a runtime error. When error returns, an event marked as failed and provided error adds to an event.

Minimalistic example:

def process(event):
    return event

Configuration

[[processors]]
  [processors.starlark]
    # script file with code
    file = "script.star"

    # starlark code
    # if both, code and file, are set
    # code will be used
    code = '''
def process(event):
    return event
    '''

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Starlark

type Starlark struct {
	*core.BaseProcessor `mapstructure:"-"`
	*common.Starlark    `mapstructure:",squash"`
	// contains filtered or unexported fields
}

func (*Starlark) Close

func (p *Starlark) Close() error

func (*Starlark) Init

func (p *Starlark) Init() error

func (*Starlark) Run

func (p *Starlark) Run()

Jump to

Keyboard shortcuts

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