From fd0446ff94e923731d867fea62e2d477921d367a Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 25 Oct 2023 11:50:50 +0000 Subject: [PATCH] [8.11](backport #36956) x-pack/filebeat/input/internal/httplog: fix incorrect append source (#36959) * x-pack/filebeat/input/internal/httplog: fix incorrect append source (#36956) (cherry picked from commit bbf0111c1d50b13e9e2742758ab19e89562ad1a4) * remove irrelevant changelog lines --------- Co-authored-by: Dan Kortschak <90160302+efd6@users.noreply.github.com> --- CHANGELOG.next.asciidoc | 1 + x-pack/filebeat/input/internal/httplog/roundtripper.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 1a8c59cd3caa..f3b36aa384e1 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -109,6 +109,7 @@ is collected by it. - Ensure winlog input retains metric collection when handling recoverable errors. {issue}36479[36479] {pull}36483[36483] - Revert error introduced in {pull}35734[35734] when symlinks can't be resolved in filestream. {pull}36557[36557] - Fix ignoring external input configuration in `take_over: true` mode {issue}36378[36378] {pull}36395[36395] +- Fix handling of response errors in HTTPJSON and CEL request trace logging. {pull}36956[36956] *Heartbeat* diff --git a/x-pack/filebeat/input/internal/httplog/roundtripper.go b/x-pack/filebeat/input/internal/httplog/roundtripper.go index bbb76cb50452..78e872efa665 100644 --- a/x-pack/filebeat/input/internal/httplog/roundtripper.go +++ b/x-pack/filebeat/input/internal/httplog/roundtripper.go @@ -158,9 +158,9 @@ func (rt *LoggingRoundTripper) RoundTrip(req *http.Request) (*http.Response, err switch len(errorsMessages) { case 0: case 1: - respParts = append(reqParts, zap.String("error.message", errorsMessages[0])) + respParts = append(respParts, zap.String("error.message", errorsMessages[0])) default: - respParts = append(reqParts, zap.Strings("error.message", errorsMessages)) + respParts = append(respParts, zap.Strings("error.message", errorsMessages)) } log.Debug("HTTP response", respParts...)