fix(inputs.lustre2): getLustreProcStats skips empty files (#16911)
Co-authored-by: Alexandre Van Kempen <alexandre.vankempen@qarnot-computing.com>
This commit is contained in:
parent
81d9937cde
commit
26e1f35524
|
|
@ -242,6 +242,11 @@ func (l *Lustre2) getLustreProcStats(fileglob string, wantedFields []*mapping) e
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if len(wholeFile) == 0 {
|
||||||
|
l.Log.Debugf("Skipping empty file %s", file)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
jobs := strings.Split(string(wholeFile), "- ")
|
jobs := strings.Split(string(wholeFile), "- ")
|
||||||
for _, job := range jobs {
|
for _, job := range jobs {
|
||||||
lines := strings.Split(job, "\n")
|
lines := strings.Split(job, "\n")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue