rules

package
v0.0.0-...-ebc7474 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IRule

type IRule interface {
	Evaluate(ctx context.Context, record shared.Record) bool
	Name() string
}

type Rule

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

func NewRule

func NewRule(name string, setters ...RuleOption) Rule

func (*Rule) ApplyDispatchers

func (r *Rule) ApplyDispatchers(ctx context.Context, alert alerts.Alert) error

ApplyDispatchers applies all dispatchers to the event.

func (*Rule) ApplyEnrichments

func (r *Rule) ApplyEnrichments(ctx context.Context, record shared.Record) error

ApplyEnrichments applies all enrichment functions to the event.

func (*Rule) ApplyFormatters

func (r *Rule) ApplyFormatters(ctx context.Context, record shared.Record) error

ApplyFormatters applies all formatters to the event.

func (*Rule) ApplyMatchers

func (r *Rule) ApplyMatchers(ctx context.Context, record shared.Record) bool

ApplyMatchers applies all matchers to the event.

func (*Rule) ApplyTuningRules

func (r *Rule) ApplyTuningRules(ctx context.Context, record shared.Record) error

ApplyTuningRules applies all tuning rules to the event.

func (*Rule) Checksum

func (r *Rule) Checksum() string

func (*Rule) Disable

func (r *Rule) Disable()

func (*Rule) Evaluate

func (r *Rule) Evaluate(ctx context.Context, record shared.Record) bool

func (*Rule) Name

func (r *Rule) Name() string

type RuleError

type RuleError struct {
	Message string
}

RuleError custom error for Rule

func (*RuleError) Error

func (e *RuleError) Error() string

type RuleOption

type RuleOption func(*Rule)

func Description

func Description(description string) RuleOption

func Disabled

func Disabled(disabled bool) RuleOption

func Dispatchers

func Dispatchers(dispatchers []dispatchers.IDispatcher) RuleOption

func Enrichments

func Enrichments(enrichments []enrichments.IEnrichment) RuleOption

func Formatters

func Formatters(formatters []formatters.IFormatter) RuleOption

func Inputs

func Inputs(inputs []inputs.IInput) RuleOption

func Matchers

func Matchers(matchers []matchers.IMatcher) RuleOption

func MergeByKeys

func MergeByKeys(mergeByKeys []string) RuleOption

func MergeWindowMins

func MergeWindowMins(mergeWindowMins int) RuleOption

func Name

func Name(name string) RuleOption

func ReqSubkeys

func ReqSubkeys(reqSubkeys []string) RuleOption

func Severity

func Severity(severity int) RuleOption

func TuningRules

func TuningRules(tuningRules []tuning_rules.ITuningRule) RuleOption

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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