Reset grokky once all patterns are compiled as we do not need to hold them in memoory (#2420)

This commit is contained in:
Laurence Jones 2023-10-13 12:53:42 +01:00 committed by GitHub
parent a6b55f2b5e
commit ff7acd3347
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -148,6 +148,12 @@ func LoadParsers(cConfig *csconfig.Config, parsers *Parsers) (*Parsers, error) {
parsers.Ctx.Profiling = true
parsers.Povfwctx.Profiling = true
}
/*
Reset CTX grok to reduce memory footprint after we compile all the patterns
*/
parsers.Ctx.Grok = grokky.Host{}
parsers.Povfwctx.Grok = grokky.Host{}
parsers.StageFiles = []Stagefile{}
parsers.PovfwStageFiles = []Stagefile{}
return parsers, nil
}