Skip to content

Commit

Permalink
Fix regex for log stripping.
Browse files Browse the repository at this point in the history
  • Loading branch information
rabbah committed Oct 31, 2019
1 parent d0f5736 commit eb5fb11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion commands/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ func stripTimestamp(log string) (strippedLog string) {
// the timestamp expected format is YYYY-MM-DDTHH:MM:SS.[0-9]+Z
// an optional " stdout" or " stderr" stream identifier
// and the rest as the log line
regex := regexp.MustCompile("\\d{4}-[01]{1}\\d{1}-[0-3]{1}\\d{1}T[0-2]{1}\\d{1}:[0-6]{1}\\d{1}:[0-6]{1}\\d{1}.\\d+Z( (stdout|stderr):)?\\s(.*)")
regex := regexp.MustCompile("\\d{4}-[01]{1}\\d{1}-[0-3]{1}\\d{1}T[0-2]{1}\\d{1}:[0-6]{1}\\d{1}:[0-6]{1}\\d{1}.\\d+Z( *(stdout|stderr):)?\\s(.*)")
match := regex.FindStringSubmatch(log)

if len(match) > 3 && len(match[3]) > 0 {
Expand Down

0 comments on commit eb5fb11

Please sign in to comment.