1 Star 0 Fork 0

sqos/beats

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
config.go 755 Bytes
一键复制 编辑 原始数据 按行查看 历史
Steffen Siering 提交于 2017-01-11 13:26 . Cleanup output codecs (#3285)
package fileout
import (
"fmt"
"github.com/elastic/beats/libbeat/logp"
"github.com/elastic/beats/libbeat/outputs"
)
type config struct {
Path string `config:"path"`
Filename string `config:"filename"`
RotateEveryKb int `config:"rotate_every_kb" validate:"min=1"`
NumberOfFiles int `config:"number_of_files"`
Codec outputs.CodecConfig `config:"codec"`
}
var (
defaultConfig = config{
NumberOfFiles: 7,
RotateEveryKb: 10 * 1024,
}
)
func (c *config) Validate() error {
if c.NumberOfFiles < 2 || c.NumberOfFiles > logp.RotatorMaxFiles {
return fmt.Errorf("The number_of_files to keep should be between 2 and %v",
logp.RotatorMaxFiles)
}
return nil
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sqos/beats.git
git@gitee.com:sqos/beats.git
sqos
beats
beats
v5.3.0

搜索帮助

344bd9b3 5694891 D2dac590 5694891