From 948e7cc9d000395ff9fccb874e215e2b7542b3ad Mon Sep 17 00:00:00 2001 From: Sergey Ponomarev Date: Thu, 26 Nov 2020 12:08:36 +0200 Subject: [PATCH] docker_logs.go use SplitN(2) --- connector/collector/docker_logs.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/connector/collector/docker_logs.go b/connector/collector/docker_logs.go index fc569ee..d8b7559 100644 --- a/connector/collector/docker_logs.go +++ b/connector/collector/docker_logs.go @@ -47,9 +47,9 @@ func (l *DockerLogs) Stream() chan models.Log { go func() { scanner := bufio.NewScanner(r) for scanner.Scan() { - parts := strings.Split(scanner.Text(), " ") + parts := strings.SplitN(scanner.Text(), " ", 2) ts := l.parseTime(parts[0]) - logCh <- models.Log{Timestamp: ts, Message: strings.Join(parts[1:], " ")} + logCh <- models.Log{Timestamp: ts, Message: parts[1]} } }()