From 5ad762434ea1520c95697bc7c1346df4918ce7e9 Mon Sep 17 00:00:00 2001 From: Dan Kortschak Date: Wed, 6 Sep 2023 13:00:35 +0930 Subject: [PATCH] x-pack/filebeat/input/httpjson: avoid fruitless map allocation --- x-pack/filebeat/input/httpjson/request.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/x-pack/filebeat/input/httpjson/request.go b/x-pack/filebeat/input/httpjson/request.go index ee1113e8c378..c2a5c5406323 100644 --- a/x-pack/filebeat/input/httpjson/request.go +++ b/x-pack/filebeat/input/httpjson/request.go @@ -847,16 +847,13 @@ func responseToMap(r *response) (mapstr.M, error) { } respMap := map[string]interface{}{ "header": make(mapstr.M), - "body": make(mapstr.M), + "body": r.body, } - for key, value := range r.header { respMap["header"] = mapstr.M{ key: value, } } - respMap["body"] = r.body - return respMap, nil }