Refactor and code cleanup of filtering
started working on this with the idea of fixing #1623, although I realized that this was actually just a documentation issue around a toml eccentricity. closes #1623
This commit is contained in:
@@ -77,13 +77,13 @@ func (s *Varnish) Gather(acc telegraf.Accumulator) error {
|
||||
if s.filter == nil {
|
||||
var err error
|
||||
if len(s.Stats) == 0 {
|
||||
s.filter, err = filter.CompileFilter(defaultStats)
|
||||
s.filter, err = filter.Compile(defaultStats)
|
||||
} else {
|
||||
// legacy support, change "all" -> "*":
|
||||
if s.Stats[0] == "all" {
|
||||
s.Stats[0] = "*"
|
||||
}
|
||||
s.filter, err = filter.CompileFilter(s.Stats)
|
||||
s.filter, err = filter.Compile(s.Stats)
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user