Esempio n. 1
0
func (f *DropEvent) CheckConfig(c common.Config) error {

	for _, field := range c.GetFields() {
		if !filter.AvailableCondition(field) {
			return fmt.Errorf("unexpected %s option in the drop_event configuration", field)
		}
	}
	return nil
}
Esempio n. 2
0
func (f *DropFields) CheckConfig(c common.Config) error {

	complete := false

	for _, field := range c.GetFields() {
		if !filter.AvailableCondition(field) {
			if field != "fields" {
				return fmt.Errorf("unexpected %s option in the drop_fields configuration", field)
			}
		}
		if field == "fields" {
			complete = true
		}
	}

	if !complete {
		return fmt.Errorf("missing fields option in the drop_fields configuration")
	}
	return nil
}