fileset

package
v6.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2017 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

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

Factory for modules

func NewFactory

func NewFactory(outlet channel.Factory, registrar *registrar.Registrar, beatVersion string,
	pipelineLoaderFactory PipelineLoaderFactory, beatDone chan struct{}) *Factory

NewFactory instantiates a new Factory

func (*Factory) Create

func (f *Factory) Create(c *common.Config, meta *common.MapStrPointer) (cfgfile.Runner, error)

Create creates a module based on a config

type Fileset

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

Fileset struct is the representation of a fileset.

func New

func New(
	modulesPath string,
	name string,
	mcfg *ModuleConfig,
	fcfg *FilesetConfig) (*Fileset, error)

New allocates a new Fileset object with the given configuration.

func (*Fileset) GetMLConfigs

func (fs *Fileset) GetMLConfigs() []mlimporter.MLConfig

GetMLConfigs returns the list of machine-learning configurations declared by this fileset.

func (*Fileset) GetPipeline

func (fs *Fileset) GetPipeline(esVersion string) (pipelineID string, content map[string]interface{}, err error)

GetPipeline returns the JSON content of the Ingest Node pipeline that parses the logs.

func (*Fileset) GetRequiredProcessors

func (fs *Fileset) GetRequiredProcessors() []ProcessorRequirement

GetRequiredProcessors returns the list of processors on which this fileset depends.

func (*Fileset) Read

func (fs *Fileset) Read(beatVersion string) error

Read reads the manifest file and evaluates the variables.

func (*Fileset) String added in v6.1.0

func (fs *Fileset) String() string

String returns the module and the name of the fileset.

type FilesetConfig

type FilesetConfig struct {
	Enabled    *bool                  `config:"enabled"`
	Var        map[string]interface{} `config:"var"`
	Prospector map[string]interface{} `config:"prospector"`
}

FilesetConfig contains the configuration file options for a fileset

type ModuleConfig

type ModuleConfig struct {
	Module  string `config:"module"     validate:"required"`
	Enabled *bool  `config:"enabled"`

	// Filesets is inlined by code, see mcfgFromConfig
	Filesets map[string]*FilesetConfig
}

ModuleConfig contains the configuration file options for a module

type ModuleOverrides

type ModuleOverrides map[string]map[string]*common.Config // module -> fileset -> Config

func (*ModuleOverrides) Get

func (mo *ModuleOverrides) Get(module, fileset string) []*common.Config

Get returns an array of configuration overrides that should be merged in order.

type ModuleRegistry

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

func NewModuleRegistry

func NewModuleRegistry(moduleConfigs []*common.Config, beatVersion string, init bool) (*ModuleRegistry, error)

NewModuleRegistry reads and loads the configured module into the registry.

func (*ModuleRegistry) Empty

func (reg *ModuleRegistry) Empty() bool

func (*ModuleRegistry) GetProspectorConfigs

func (reg *ModuleRegistry) GetProspectorConfigs() ([]*common.Config, error)

func (*ModuleRegistry) InfoString

func (reg *ModuleRegistry) InfoString() string

InfoString returns the enabled modules and filesets in a single string, ready to be shown to the user

func (*ModuleRegistry) LoadML

func (reg *ModuleRegistry) LoadML(esClient PipelineLoader) error

LoadML loads the machine-learning configurations into Elasticsearch, if Xpack is available

func (*ModuleRegistry) LoadPipelines

func (reg *ModuleRegistry) LoadPipelines(esClient PipelineLoader) error

LoadPipelines loads the pipelines for each configured fileset.

type PipelineLoader

type PipelineLoader interface {
	LoadJSON(path string, json map[string]interface{}) ([]byte, error)
	Request(method, path string, pipeline string, params map[string]string, body interface{}) (int, []byte, error)
	GetVersion() string
}

PipelineLoader is a subset of the Elasticsearch client API capable of loading the pipelines.

type PipelineLoaderFactory

type PipelineLoaderFactory func() (PipelineLoader, error)

PipelineLoader factory builds and returns a PipelineLoader

type ProcessorRequirement

type ProcessorRequirement struct {
	Name   string `config:"name"`
	Plugin string `config:"plugin"`
}

ProcessorRequirement represents the declaration of a dependency to a particular Ingest Node processor / plugin.

Jump to

Keyboard shortcuts

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