analyzer

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: BSD-3-Clause Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run added in v0.0.6

func Run(ctx context.Context, pcap io.Reader, w zio.Writer, d Display, interval time.Duration, cs ...Config) error

Run executes the provided configs against the pcap stream, writing the produced values to w. If interval is > 0, the d.Stats will be called at that interval.

Types

type Combiner

type Combiner struct {
	// contains filtered or unexported fields
}

A Combiner is a zio.Reader that returns records by reading from multiple Readers.

func NewCombiner added in v1.7.0

func NewCombiner(ctx context.Context, readers []zio.Reader) *Combiner

func (*Combiner) Read added in v1.7.0

func (c *Combiner) Read() (*zed.Value, error)

type Config

type Config struct {
	Args []string `yaml:"args,omitempty"`
	// Cmd is the command to run for this analyzer (required).
	Cmd      string   `yaml:"cmd"`
	Disabled bool     `yaml:"disabled,omitempty"`
	Globs    []string `yaml:"globs,omitempty"`
	// Name is a unique selector for this analyzer (required).
	Name       string           `yaml:"name"`
	ReaderOpts anyio.ReaderOpts `yaml:"-"`
	Shaper     string           `yaml:"shaper,omitempty"`
	StdoutPath string           `yaml:"stdout,omitempty"`
	StderrPath string           `yaml:"stderr,omitempty"`
	// WorkDir if set uses the provided directory as the working directory for
	// the launched analyzer process. Normally a temporary directory is created
	// then deleted when the process is complete. If WorkDir is set the working
	// directory will not be deleted.
	WorkDir string `yaml:"workdir,omitempty"`
}

func (*Config) SetFlags added in v1.0.4

func (c *Config) SetFlags(fs *flag.FlagSet)

func (Config) Validate added in v1.0.4

func (c Config) Validate() error

type Configs added in v0.0.6

type Configs []Config

func (Configs) Validate added in v0.0.6

func (cs Configs) Validate() (merr error)

type Display added in v0.0.6

type Display interface {
	ztail.Warner
	Stats(Stats) error
}

type ProcessExitError

type ProcessExitError struct {
	Err    *exec.ExitError
	Path   string
	Stderr []byte
	Stdout []byte
}

func (*ProcessExitError) Error

func (p *ProcessExitError) Error() string

type Stats added in v0.0.6

type Stats struct {
	BytesRead     int64
	ValuesWritten int64
}

Jump to

Keyboard shortcuts

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