From bbf0111c1d50b13e9e2742758ab19e89562ad1a4 Mon Sep 17 00:00:00 2001 From: Dan Kortschak <90160302+efd6@users.noreply.github.com> Date: Wed, 25 Oct 2023 20:46:50 +1030 Subject: [PATCH] x-pack/filebeat/input/internal/httplog: fix incorrect append source (#36956) --- 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 a8b019f0863..43427a7365b 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -113,6 +113,7 @@ is collected by it. - Fix ignoring external input configuration in `take_over: true` mode {issue}36378[36378] {pull}36395[36395] - Add validation to http_endpoint config for empty URL {pull}36816[36816] {issue}36772[36772] - Fix merging of array fields(processors, paths, parsers) in configurations generated from hints and default config. {issue}36838[36838] {pull}36857[36857] +- 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 bbb76cb5045..78e872efa66 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...)