@@ -48,6 +48,8 @@ type DynamicReadinessTracker struct {
4848 saveLogsOnlyForContainers []string
4949 saveLogsByRegex * regexp.Regexp
5050 saveLogsByRegexForContainers map [string ]* regexp.Regexp
51+ skipLogsByRegex * regexp.Regexp
52+ skipLogsByRegexForContainers map [string ]* regexp.Regexp
5153 ignoreLogs bool
5254 ignoreLogsForContainers []string
5355 saveEvents bool
@@ -164,6 +166,8 @@ func NewDynamicReadinessTracker(
164166 saveLogsOnlyForContainers : opts .SaveLogsOnlyForContainers ,
165167 saveLogsByRegex : opts .SaveLogsByRegex ,
166168 saveLogsByRegexForContainers : opts .SaveLogsByRegexForContainers ,
169+ skipLogsByRegex : opts .SkipLogsByRegex ,
170+ skipLogsByRegexForContainers : opts .SkipLogsByRegexForContainers ,
167171 ignoreLogs : opts .IgnoreLogs ,
168172 ignoreLogsForContainers : opts .IgnoreLogsForContainers ,
169173 saveEvents : opts .SaveEvents ,
@@ -178,6 +182,8 @@ type DynamicReadinessTrackerOptions struct {
178182 SaveLogsOnlyForContainers []string
179183 SaveLogsByRegex * regexp.Regexp
180184 SaveLogsByRegexForContainers map [string ]* regexp.Regexp
185+ SkipLogsByRegex * regexp.Regexp
186+ SkipLogsByRegexForContainers map [string ]* regexp.Regexp
181187 IgnoreLogs bool
182188 IgnoreLogsForContainers []string
183189 SaveEvents bool
@@ -1201,6 +1207,29 @@ func (t *DynamicReadinessTracker) handlePodLogChunk(logChunk *pod.PodLogChunk, l
12011207 }
12021208
12031209 logLines := logChunk .LogLines
1210+
1211+ if t .skipLogsByRegex != nil {
1212+ var filteredLogLines []display.LogLine
1213+ for _ , logLine := range logLines {
1214+ if ! t .skipLogsByRegex .MatchString (logLine .Message ) {
1215+ filteredLogLines = append (filteredLogLines , logLine )
1216+ }
1217+ }
1218+ logLines = filteredLogLines
1219+ }
1220+
1221+ if len (t .skipLogsByRegexForContainers ) > 0 {
1222+ if regex , ok := t .skipLogsByRegexForContainers [logChunk .ContainerName ]; ok {
1223+ var filteredLogLines []display.LogLine
1224+ for _ , logLine := range logLines {
1225+ if ! regex .MatchString (logLine .Message ) {
1226+ filteredLogLines = append (filteredLogLines , logLine )
1227+ }
1228+ }
1229+ logLines = filteredLogLines
1230+ }
1231+ }
1232+
12041233 if t .saveLogsByRegex != nil {
12051234 var filteredLogLines []display.LogLine
12061235 for _ , logLine := range logLines {
0 commit comments