From dc5cf515bccfcf8e46eda824a64b5f04c7a256f4 Mon Sep 17 00:00:00 2001 From: Nicolas Ruflin Date: Mon, 28 Jan 2019 16:04:55 +0100 Subject: [PATCH] [Metricbeat] Rename http.request.body to http.request.body.content for ECS (#10315) The header fields were not touched in this change as not defined yet in ECS. --- CHANGELOG.next.asciidoc | 1 + dev-tools/ecs-migration.yml | 6 ++++++ metricbeat/docs/fields.asciidoc | 10 ---------- metricbeat/module/http/_meta/fields.yml | 4 ---- metricbeat/module/http/fields.go | 2 +- metricbeat/module/http/json/json.go | 4 +++- 6 files changed, 11 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index ebb406f8358..5490415db87 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -75,6 +75,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - Refactor Prometheus metric mappings {pull}9948[9948] - Removed Prometheus stats metricset in favor of just using Prometheus collector {pull}9948[9948] - Adjust Redis.info metricset fields to ECS. {pull}10319[10319] +- Rename http.request.body field to http.request.body.content. {pull}10315[10315] *Packetbeat* diff --git a/dev-tools/ecs-migration.yml b/dev-tools/ecs-migration.yml index e2369ba2e28..436a844fae3 100644 --- a/dev-tools/ecs-migration.yml +++ b/dev-tools/ecs-migration.yml @@ -1223,6 +1223,12 @@ alias: true beat: metricbeat +### HTTP +- from: http.request.body + to: http.request.body.content + alias: false + beat: metricbeat + ### Zookeeper - from: zookeeper.mntr.version diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index aae6b1282c6..0822cecc4d8 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -10543,16 +10543,6 @@ type: object The HTTP headers sent --- - -*`http.request.body`*:: -+ --- -type: keyword - -The HTTP payload sent - - -- [float] diff --git a/metricbeat/module/http/_meta/fields.yml b/metricbeat/module/http/_meta/fields.yml index f51a9a64774..a9c3080f824 100644 --- a/metricbeat/module/http/_meta/fields.yml +++ b/metricbeat/module/http/_meta/fields.yml @@ -18,10 +18,6 @@ type: object description: > The HTTP headers sent - - name: body - type: keyword - description: > - The HTTP payload sent - name: response type: group description: > diff --git a/metricbeat/module/http/fields.go b/metricbeat/module/http/fields.go index 697157587f7..68862c3e815 100644 --- a/metricbeat/module/http/fields.go +++ b/metricbeat/module/http/fields.go @@ -32,5 +32,5 @@ func init() { // AssetHttp returns asset data. // This is the base64 encoded gzipped contents of ../metricbeat/module/http. func AssetHttp() string { - return "eJzMlDFvwjAQhff8iqfMRerAlKFzp6oDW9XBxA8wJHHqu9Dm31cBQklqkCit1Btt53ufz7En2LDNsFKtE0CdFsyQPs5mz2kCWEoeXK3OVxkeEgDoplB62xRMgMCCRphhaRJAqOqqpWR4SUWK9A5pB05fE2DhWFjJdowJKlPymNqVtnVHCb7pRyLZQ8opKfCtoehxPAY8C+1rt7UDCa5a+FCabuXJsnH+YDc0lkFG0L2Hn6+Z62jqogwwW3GvdABDWGk0ee5tG43dsH33wf4wtzZt4Y0d5n51XGpfCX+l5XvUf+x5YE63pY2m597yD/ouarSRGJ0fpqy7Gzq9n0aN6lUwco3TkfjkFQvfVDdKjwR6r7UMjvTqP6X7HiU1uFx4eqbDB6ivc8+EMGwZbhH5Rrgs8BkAAP//p5Fb6Q==" + return "eJzMlDFv6jAUhff8iqPMD+kNTBne/KanN7BVHdz4AIbETn1vaPn3lYEgkhokSofe0Tbf+Y6MM8OW+wpr1a4A1GnDCuXfxeJ/WQCWUkfXqQu+wp8CANIW2mD7hgUQ2dAIK6xMAQhVnV9JhadSpCl/oUzg8rkAlo6NlerAmMGblufUNLrvEiWGfljJZI8pl6TI156i5/Uc8Cp0mEO1EwnOL0NsTTp5cWyaP2pDYxllAj16hJcNa51s3ZQBFmselU5gCL1mmksXvPBbqh9RP7F7ZE23o82m18EyG73l/i1E+8VsUaO95Oh8N22XXsr89zxr1K2jkXuczsR/QbEMvX9QeiIweG1kdKV3/1PS79FSo6uFl3c6/hAMc+25CuOO8RGRT4TbAh8BAAD//zeEPwk=" } diff --git a/metricbeat/module/http/json/json.go b/metricbeat/module/http/json/json.go index faa8ef72f05..f99826689da 100644 --- a/metricbeat/module/http/json/json.go +++ b/metricbeat/module/http/json/json.go @@ -130,7 +130,9 @@ func (m *MetricSet) processBody(response *http.Response, jsonBody interface{}) c "request": common.MapStr{ "headers": m.getHeaders(response.Request.Header), "method": response.Request.Method, - "body": m.body, + "body": common.MapStr{ + "content": m.body, + }, }, } }