From 26e1f355242d1f0e9e7953c1862997159306e259 Mon Sep 17 00:00:00 2001 From: alexvkempen <81248032+alexvkempen@users.noreply.github.com> Date: Wed, 30 Apr 2025 18:15:15 +0200 Subject: [PATCH] fix(inputs.lustre2): getLustreProcStats skips empty files (#16911) Co-authored-by: Alexandre Van Kempen --- plugins/inputs/lustre2/lustre2.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/inputs/lustre2/lustre2.go b/plugins/inputs/lustre2/lustre2.go index ef570f2c0..a9c51de8f 100644 --- a/plugins/inputs/lustre2/lustre2.go +++ b/plugins/inputs/lustre2/lustre2.go @@ -242,6 +242,11 @@ func (l *Lustre2) getLustreProcStats(fileglob string, wantedFields []*mapping) e if err != nil { return err } + if len(wholeFile) == 0 { + l.Log.Debugf("Skipping empty file %s", file) + continue + } + jobs := strings.Split(string(wholeFile), "- ") for _, job := range jobs { lines := strings.Split(job, "\n")