From cc5b346d87df46171a4a2f90344e2fa19a12b787 Mon Sep 17 00:00:00 2001 From: Derek Horton Date: Fri, 6 Sep 2024 16:36:50 -0500 Subject: [PATCH] Adjust truncated output --- internal/validator/handler.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/validator/handler.go b/internal/validator/handler.go index 311668a8..e320c6a4 100644 --- a/internal/validator/handler.go +++ b/internal/validator/handler.go @@ -173,6 +173,8 @@ func (this *handler) validateContent(ctx context.Context, requestType string, da log.Debug("Payload too big. Truncating payload.") } + var truncated string = "Truncated..." + lines := strings.Split(string(data), "\n") for i, line := range lines { @@ -193,8 +195,8 @@ func (this *handler) validateContent(ctx context.Context, requestType string, da if i > 500 && truncateData { if validatedEvent.Console != nil || *validatedEvent.Console != "" { - var truncated string = "Truncated..." validatedEvent.Console = &truncated + truncated = "" } } @@ -207,8 +209,8 @@ func (this *handler) validateContent(ctx context.Context, requestType string, da } if i > 500 && i < len(lines)-2 && truncateData { - var truncated string = "Truncated..." validatedEvent.Stdout = &truncated + truncated = "" } events.Playbook = append(events.Playbook, *validatedEvent)