Commit Graph
4 Commits
Author SHA1 Message Date
Veer Singh 4334390423 Cache the joined log buffer and skip it for single-line rules
The log buffer joins every buffered line and scans all of them for
each pattern on every push, which is wasted work when a pattern
cannot even match across lines. The buffer now caches the joined
string, and Push invalidates the cache. CompilePattern marks the
patterns that cannot match across lines (no start anchor, no way to
match a newline, and the appended \z anchor binds every branch) and
Match checks them against the most recent line alone.
2026-07-27 16:37:28 -07:00
Ciprian Hacman b02e2dcd09 Precompile log buffer regular expressions
Compile fixed patterns during monitor and log counter initialization, pass compiled expressions to the log buffer, and reject invalid log counter patterns before watching logs.
2026-07-25 09:21:31 +03:00
Veer Singh be4034f35a Cache compiled regular expressions in the log buffer
This change keeps each compiled regular expression in a cache in the
log buffer. The cache size is not more than the number of patterns
given to Match.

This change removes the TODO in log_buffer.go.
2026-07-20 16:12:36 -07:00
Random-Liu 10fc831409 Change kernel specific name in code base and change syslog to filelog. 2017-02-15 13:07:01 -08:00