1 Star 0 Fork 0

zhangjungang/beats

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
config.go 973 Bytes
一键复制 编辑 原始数据 按行查看 历史
urso 提交于 2017-08-08 16:47 . review fixes
// 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()
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangjungang/beats.git
git@gitee.com:zhangjungang/beats.git
zhangjungang
beats
beats
v6.2.1

搜索帮助