From ace94f0642a03aac0a94704bb8600b28be253418 Mon Sep 17 00:00:00 2001 From: Mario Castro Date: Tue, 23 Oct 2018 12:37:09 +0200 Subject: [PATCH] Fix metricbeat http module not parsing headers correctly #8564 (#8585) Fix typo in headers naming on HTTP Metricbeat module --- CHANGELOG.asciidoc | 1 + libbeat/tests/system/beat/beat.py | 5 ++++- metricbeat/docs/fields.asciidoc | 4 ++-- metricbeat/module/http/_meta/fields.yml | 4 ++-- metricbeat/module/http/fields.go | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index e0e2edc9cc7..c95b4f27633 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -88,6 +88,7 @@ https://github.com/elastic/beats/compare/v6.4.0...master[Check the HEAD diff] - Avoid mapping issues in kubernetes module. {pull}8487[8487] - Fix issue that would prevent kafka module to find a proper broker when port is not set {pull}8613[8613] - Fix range colors in multiple visualizations. {issue}8633[8633] {pull}8634[8634] +- Fix incorrect header parsing on http metricbeat module {issue}8564[8564] {pull}8585[8585] *Packetbeat* diff --git a/libbeat/tests/system/beat/beat.py b/libbeat/tests/system/beat/beat.py index 6e5659fffd5..daf10fbe3fb 100644 --- a/libbeat/tests/system/beat/beat.py +++ b/libbeat/tests/system/beat/beat.py @@ -61,6 +61,8 @@ def start(self): stderr=subprocess.STDOUT, bufsize=0, ) + # If a "No such file or directory" error points you here, run + # "make metricbeat.test" on metricbeat folder return self.proc def kill(self): @@ -501,7 +503,8 @@ def extract_fields(doc_list, name): global yaml_cache - # TODO: Make fields_doc path more generic to work with beat-generator + # TODO: Make fields_doc path more generic to work with beat-generator. If it can't find file + # "fields.yml" you should run "make update" on metricbeat folder with open(fields_doc, "r") as f: path = os.path.abspath(os.path.dirname(__file__) + "../../../../fields.yml") if not os.path.isfile(path): diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index 3def7e6282a..97b57d4adfb 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -8633,7 +8633,7 @@ HTTP request information -*`http.request.header`*:: +*`http.request.headers`*:: + -- type: object @@ -8660,7 +8660,7 @@ HTTP response information -*`http.response.header`*:: +*`http.response.headers`*:: + -- type: object diff --git a/metricbeat/module/http/_meta/fields.yml b/metricbeat/module/http/_meta/fields.yml index 13905e1659a..f51a9a64774 100644 --- a/metricbeat/module/http/_meta/fields.yml +++ b/metricbeat/module/http/_meta/fields.yml @@ -14,7 +14,7 @@ description: > HTTP request information fields: - - name: header + - name: headers type: object description: > The HTTP headers sent @@ -27,7 +27,7 @@ description: > HTTP response information fields: - - name: header + - name: headers type: object description: > The HTTP headers received diff --git a/metricbeat/module/http/fields.go b/metricbeat/module/http/fields.go index ecf80c12671..90c66022b1d 100644 --- a/metricbeat/module/http/fields.go +++ b/metricbeat/module/http/fields.go @@ -31,5 +31,5 @@ func init() { // Asset returns asset data func Asset() string { - return "eJzMlD1vszAUhXd+xRHzG+kdMjF07lR1yFZ1cPBJ4gQw9b2k5d9XhEIDdSqlH1LvaJvnPL42XuDANsNOtU4AdVowQ3q7Wt2nCWApeXC1Ol9luEkAoJtC6W1TMAECCxphhq1JAKGqq7aS4SEVKdJ/SDtw+pgAG8fCSnZiLFCZkmNqV9rWHSX4ZhiJZE8p56TAp4ai43gMeBE61GlrbyS4auNDabqVZ8vm+ZPd0FiGGbPX8Os9c51NfeoCrHbsjXquQFhpNHjtbRuNPbB99sF+Mbc2beGNnea+N1xqXwl/pOM96g+2PDCnO9JGw3Nv+QttFzXaSIzOF1PW3f+5/L+MGtW7YOQap5F45xUb31TflJ4JDF57mZzo1Rel+x4lNbhceH6m0+dnqEuPhDAcJ7flapEPhFFgTY0pvAYAAP//U2hb1w==" + return "eJzMlLFO8zAUhfc8xVHmv9I/dMrAzIQYuiEGNz5t3SZx8L0p5O1R2iY0wUUqBYk72s53Pl/HnmHHNsNGtU4AdVowQ3q/WDymCWApeXC1Ol9luEsAoJtC6W1TMAECCxphhrVJAKGqq9aS4SkVKdJ/SDtw+pwAK8fCSnZgzFCZkkNqV9rWHSX4ph+JZI8p56TAl4aiw3gMeBHa12FrJxJctfKhNN3Ks2XT/NFuaCyDTKBHD7/cMtfJ1JcywGLDo9IJDGGl0eSlt200dsf21Qf7zdzatIU3dpz70XGpfSX8kZYfUX+x54E53Z42mp57y1/ou6jRRmJ0vpmy7m7o/P88alRvgpFrnAbig1esfFPdKD0R6L22MjrSq/+U7nuU1OBy4fmZjh+gvi49E8KwZ7hF5BNhEFhSYwrvAQAA//9oZVy9" }