acquisition

package
v1.5.6-rc9 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: MIT Imports: 29 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AcquisitionSources = map[string]func() DataSource{
	"file":        func() DataSource { return &fileacquisition.FileSource{} },
	"journalctl":  func() DataSource { return &journalctlacquisition.JournalCtlSource{} },
	"cloudwatch":  func() DataSource { return &cloudwatchacquisition.CloudwatchSource{} },
	"syslog":      func() DataSource { return &syslogacquisition.SyslogSource{} },
	"docker":      func() DataSource { return &dockeracquisition.DockerSource{} },
	"kinesis":     func() DataSource { return &kinesisacquisition.KinesisSource{} },
	"wineventlog": func() DataSource { return &wineventlogacquisition.WinEventLogSource{} },
	"kafka":       func() DataSource { return &kafkaacquisition.KafkaSource{} },
	"k8s-audit":   func() DataSource { return &k8sauditacquisition.KubernetesAuditSource{} },
	"loki":        func() DataSource { return &lokiacquisition.LokiSource{} },
	"s3":          func() DataSource { return &s3acquisition.S3Source{} },
	"appsec":      func() DataSource { return &appsecacquisition.AppsecSource{} },
}

Functions

func GetMetrics added in v1.1.0

func GetMetrics(sources []DataSource, aggregated bool) error

func StartAcquisition added in v1.0.0

func StartAcquisition(sources []DataSource, output chan types.Event, AcquisTomb *tomb.Tomb) error

Types

type DataSource added in v1.0.0

type DataSource interface {
	GetMetrics() []prometheus.Collector                                 // Returns pointers to metrics that are managed by the module
	GetAggregMetrics() []prometheus.Collector                           // Returns pointers to metrics that are managed by the module (aggregated mode, limits cardinality)
	UnmarshalConfig([]byte) error                                       // Decode and pre-validate the YAML datasource - anything that can be checked before runtime
	Configure([]byte, *log.Entry) error                                 // Complete the YAML datasource configuration and perform runtime checks.
	ConfigureByDSN(string, map[string]string, *log.Entry, string) error // Configure the datasource
	GetMode() string                                                    // Get the mode (TAIL, CAT or SERVER)
	GetName() string                                                    // Get the name of the module
	OneShotAcquisition(chan types.Event, *tomb.Tomb) error              // Start one shot acquisition(eg, cat a file)
	StreamingAcquisition(chan types.Event, *tomb.Tomb) error            // Start live acquisition (eg, tail a file)
	CanRun() error                                                      // Whether the datasource can run or not (eg, journalctl on BSD is a non-sense)
	GetUuid() string                                                    // Get the unique identifier of the datasource
	Dump() interface{}
}

The interface each datasource must implement

func DataSourceConfigure added in v1.0.0

func DataSourceConfigure(commonConfig configuration.DataSourceCommonCfg) (*DataSource, error)

DataSourceConfigure creates and returns a DataSource object from a configuration, if the configuration is not valid it returns an error. If the datasource can't be run (eg. journalctl not available), it still returns an error which can be checked for the appropriate action.

func GetDataSourceIface added in v1.1.0

func GetDataSourceIface(dataSourceType string) DataSource

func LoadAcquisitionFromDSN added in v1.1.0

func LoadAcquisitionFromDSN(dsn string, labels map[string]string, transformExpr string) ([]DataSource, error)

func LoadAcquisitionFromFile added in v1.0.0

func LoadAcquisitionFromFile(config *csconfig.CrowdsecServiceCfg) ([]DataSource, error)

LoadAcquisitionFromFile unmarshals the configuration item and checks its availability

type DataSourceUnavailableError added in v1.5.3

type DataSourceUnavailableError struct {
	Name string
	Err  error
}

func (*DataSourceUnavailableError) Error added in v1.5.3

func (*DataSourceUnavailableError) Unwrap added in v1.5.3

func (e *DataSourceUnavailableError) Unwrap() error

Jump to

Keyboard shortcuts

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