From b7b528277014879e436ae7fe1f3851024938fbd3 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 17 Jun 2020 12:59:15 +0100 Subject: initial log monitoring support --- internal/mapr/aggregateset.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'internal/mapr/aggregateset.go') diff --git a/internal/mapr/aggregateset.go b/internal/mapr/aggregateset.go index 7fb4c17..fdf8db2 100644 --- a/internal/mapr/aggregateset.go +++ b/internal/mapr/aggregateset.go @@ -2,9 +2,12 @@ package mapr import ( "context" + "encoding/base64" "fmt" "strconv" "strings" + + "github.com/mimecast/dtail/internal/io/logger" ) // AggregateSet represents aggregated key/value pairs from the @@ -82,6 +85,15 @@ func (s *AggregateSet) Serialize(ctx context.Context, groupKey string, ch chan<- for k, v := range s.SValues { sb.WriteString(k) sb.WriteString("=") + if k == "$line" { + decoded, err := base64.StdEncoding.DecodeString(v) + if err != nil { + logger.Error("Unable to decode $line", err, v) + } + sb.WriteString(string(decoded)) + sb.WriteString("|") + continue + } sb.WriteString(v) sb.WriteString("|") } -- cgit v1.2.3