Documentation ¶
Index ¶
- Variables
- func GetMetrics(sources []DataSource, aggregated bool) error
- func StartAcquisition(sources []DataSource, output chan types.Event, AcquisTomb *tomb.Tomb) error
- type DataSource
- func DataSourceConfigure(commonConfig configuration.DataSourceCommonCfg) (*DataSource, error)
- func GetDataSourceIface(dataSourceType string) DataSource
- func LoadAcquisitionFromDSN(dsn string, labels map[string]string) ([]DataSource, error)
- func LoadAcquisitionFromFile(config *csconfig.CrowdsecServiceCfg) ([]DataSource, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var AcquisitionSources = []struct { name string iface func() DataSource }{ { // contains filtered or unexported fields }, { // contains filtered or unexported fields }, { // contains filtered or unexported fields }, { // contains filtered or unexported fields }, { // contains filtered or unexported fields }, { // contains filtered or unexported fields }, { // contains filtered or unexported fields }, }
Functions ¶
func GetMetrics ¶ added in v1.1.0
func GetMetrics(sources []DataSource, aggregated bool) error
func StartAcquisition ¶ added in v1.0.0
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) Configure([]byte, *log.Entry) error // Configure the datasource ConfigureByDSN(string, map[string]string, *log.Entry) 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) Dump() interface{} }
The interface each datasource must implement
func DataSourceConfigure ¶ added in v1.0.0
func DataSourceConfigure(commonConfig configuration.DataSourceCommonCfg) (*DataSource, error)
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) ([]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
Click to show internal directories.
Click to hide internal directories.