Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTasks ¶
func GetTasks(config Config) map[string]*TaskConfig
GetTasks根据主配置定义的从配置目录,获取采集器定义的任务列表
Types ¶
type ConditionConfig ¶
type ConditionConfig struct { Index int `config:"index"` Key string `config:"key"` Op string `config:"op"` }
ConditionConfig: 用于条件表达式,目前支持=、!=
type ConditionSortByIndex ¶
type ConditionSortByIndex []ConditionConfig
condition配置
func (ConditionSortByIndex) Len ¶
func (a ConditionSortByIndex) Len() int
Len is the number of elements in the collection.
func (ConditionSortByIndex) Less ¶
func (a ConditionSortByIndex) Less(i, j int) bool
Len is the number of elements in the collection.
func (ConditionSortByIndex) Swap ¶
func (a ConditionSortByIndex) Swap(i, j int)
Swap swaps the elements with indexes i and j.
type Config ¶
type Config struct { // Max bytes for buffer MaxBytes int `config:"maxbytes"` // max line for buffer Maxline int `config:"maxline"` // timeout for buffer BufferTimeout time.Duration `config:"buffertimeout"` // max cpu limit percent MaxCpuLimit int `config:"max_cpu_limit"` // 最大CPU限制,仅在某些极端情况下开启 // CpuCheckTimes CpuCheckTimes int `config:"cpu_check_times"` // 1秒内检测多少次CPU, 可选值,[1-10] // SecConfigs sec config path and pattern SecConfigs []SecConfigItem `config:"multi_config"` Registry Registry `config:"registry"` }
主配置
type FilterConfig ¶
type FilterConfig struct {
Conditions []ConditionConfig `config:"conditions"`
}
FilterConfig line filter config
type Registry ¶
type Registry struct { FlushTimeout time.Duration `config:"flush"` GcFrequency time.Duration `config:"gc_frequency"` }
采集状态
type SecConfigItem ¶
从配置目录
type TaskConfig ¶
type TaskConfig struct { ID string Type string `config:"type"` DataID int `config:"dataid"` // Processor Processors processors.PluginConfig `config:"processors"` Delimiter string `config:"delimiter"` Filters []FilterConfig `config:"filters"` HasFilter bool // Sender CanPackage bool `config:"package"` PackageCount int `config:"package_count"` ExtMeta interface{} `config:"ext_meta"` // Output RemovePathPrefix string `config:"remove_path_prefix"` // 去除路径前缀 IsContainerStd bool `config:"is_container_std"` // 是否为容器标准输出日志 OutputFormat string `config:"output_format"` // 输出格式,为了兼容老版采集器的输出格式 RawConfig *beat.Config }
采集任务配置
func CreateTaskConfig ¶
func CreateTaskConfig(vars map[string]interface{}) (*TaskConfig, error)
CreateTaskConfig: 根据字典生成任务配置
func (*TaskConfig) Same ¶
func (sourceConfig *TaskConfig) Same(targetConfig *TaskConfig) bool
Same用于采集器reload时,比较同一dataid的任务是否有做调整
Click to show internal directories.
Click to hide internal directories.