telegraf/plugins/outputs/health/contains.go

20 lines
300 B
Go
Raw Normal View History

2019-05-30 01:31:06 +00:00
package health
import "github.com/influxdata/telegraf"
type Contains struct {
Field string `toml:"field"`
}
func (c *Contains) Check(metrics []telegraf.Metric) bool {
success := false
for _, m := range metrics {
ok := m.HasField(c.Field)
if ok {
success = true
}
}
return success
}