kernelvmstat support whitelist

This commit is contained in:
Ulric Qin 2022-04-20 17:03:55 +08:00
parent dbf0d9c22c
commit 55eb38f53f
1 changed files with 6 additions and 2 deletions

View File

@ -70,10 +70,14 @@ func (s *KernelVmstat) Gather() (samples []*types.Sample) {
continue
}
fields[string(field)] = m
key := string(field)
if need, has := s.WhiteList[key]; has && need == 1 {
fields[key] = m
}
}
}
return
return inputs.NewSamples(fields)
}
func (s *KernelVmstat) getProcVmstat() ([]byte, error) {