diff --git a/lib/logstorage/pipe_stats.go b/lib/logstorage/pipe_stats.go index 77504dec2..90fdb0c73 100644 --- a/lib/logstorage/pipe_stats.go +++ b/lib/logstorage/pipe_stats.go @@ -133,16 +133,18 @@ func (ps *pipeStats) hasFilterInWithQuery() bool { func (ps *pipeStats) initFilterInValues(cache map[string][]string, getFieldValuesFunc getFieldValuesFunc) (pipe, error) { funcsNew := make([]pipeStatsFunc, len(ps.funcs)) - for i, f := range ps.funcs { + for i := range ps.funcs { + f := &ps.funcs[i] iffNew, err := f.iff.initFilterInValues(cache, getFieldValuesFunc) if err != nil { return nil, err } - f.iff = iffNew - funcsNew[i] = f + fNew := *f + fNew.iff = iffNew + funcsNew[i] = fNew } psNew := *ps - ps.funcs = funcsNew + psNew.funcs = funcsNew return &psNew, nil }