From 1003d6d907b580777ad945c757ae4db2184352ce Mon Sep 17 00:00:00 2001 From: Paul Krizak Date: Wed, 26 Feb 2025 16:43:55 -0800 Subject: [PATCH] Eliminate logspam using filelog monitor When using a filelog monitor, the top-level `pluginConfig.message` filter provides a limited stream of log events to be checked against the `rules[].pattern`. I thus expect it to be normal for most log events to fail to match the top-level `pluginConfig.message` filter. Such a condition should not trigger a warning-level log message. And in fact such log messages should be suppressed by default, unless `-v=5` or higher is used for troubleshooting/debug purposes. --- pkg/systemlogmonitor/logwatchers/filelog/log_watcher.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/systemlogmonitor/logwatchers/filelog/log_watcher.go b/pkg/systemlogmonitor/logwatchers/filelog/log_watcher.go index f0b8259be..7627959c1 100644 --- a/pkg/systemlogmonitor/logwatchers/filelog/log_watcher.go +++ b/pkg/systemlogmonitor/logwatchers/filelog/log_watcher.go @@ -121,7 +121,7 @@ func (s *filelogWatcher) watchLoop() { } log, err := s.translator.translate(strings.TrimSuffix(line, "\n")) if err != nil { - klog.Warningf("Unable to parse line: %q, %v", line, err) + klog.V(5).Infof("Unable to parse line: %q, %v", line, err) continue } // Discard messages before start time.