mirror of
https://github.com/Icinga/icingabeat.git
synced 2025-08-28 21:28:09 +02:00
41 lines
973 B
Go
41 lines
973 B
Go
// Package config provides the winlogbeat specific configuration options.
|
|
package config
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/joeshaw/multierror"
|
|
|
|
"github.com/elastic/beats/libbeat/common"
|
|
)
|
|
|
|
const (
|
|
// DefaultRegistryFile specifies the default filename of the registry file.
|
|
DefaultRegistryFile = ".winlogbeat.yml"
|
|
)
|
|
|
|
var (
|
|
DefaultSettings = WinlogbeatConfig{
|
|
RegistryFile: DefaultRegistryFile,
|
|
}
|
|
)
|
|
|
|
// WinlogbeatConfig contains all of Winlogbeat configuration data.
|
|
type WinlogbeatConfig struct {
|
|
EventLogs []*common.Config `config:"event_logs"`
|
|
RegistryFile string `config:"registry_file"`
|
|
}
|
|
|
|
// Validate validates the WinlogbeatConfig data and returns an error describing
|
|
// all problems or nil if there are none.
|
|
func (ebc WinlogbeatConfig) Validate() error {
|
|
var errs multierror.Errors
|
|
|
|
if len(ebc.EventLogs) == 0 {
|
|
errs = append(errs, fmt.Errorf("At least one event log must be "+
|
|
"configured as part of event_logs"))
|
|
}
|
|
|
|
return errs.Err()
|
|
}
|