Skip to content

Commit

Permalink
i5354: Harmonize field names between Packetbeat HTTP and Metricbeat M…
Browse files Browse the repository at this point in the history
…odule
  • Loading branch information
christiangalsterer committed Nov 10, 2017
1 parent 8ae5b4b commit 12fae93
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ https://github.com/elastic/beats/compare/v6.0.0-beta2...master[Check the HEAD di
*Metricbeat*

- Rename `heap_init` field to `heap.init`. {pull}5320[5320]
- Rename `http.response.status_code` field to `http.response.code`. {pull}5521[5521]


*Packetbeat*
Expand Down
4 changes: 3 additions & 1 deletion metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4546,10 +4546,12 @@ The HTTP headers received
[float]
=== `http.response.status_code`
=== `http.response.code`
type: keyword
example: 404
The HTTP status code
Expand Down
3 changes: 2 additions & 1 deletion metricbeat/module/http/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@
type: object
description: >
The HTTP headers received
- name: status_code
- name: code
type: keyword
description: >
The HTTP status code
example: 404
- name: phrase
type: keyword
example: Not found
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/module/http/json/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Example:
"Server": "Google Frontend",
"X-Cloud-Trace-Context": "3f532d170112fc5b2a0b94fcbd6493b3"
},
"status_code": 200
"code": 200
}
},
"metricset": {
Expand Down
6 changes: 3 additions & 3 deletions metricbeat/module/http/json/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ func (m *MetricSet) Fetch() (common.MapStr, error) {
phrase := strings.TrimPrefix(response.Status, strconv.Itoa(response.StatusCode)+" ")
event[mb.ModuleDataKey] = common.MapStr{
"response": common.MapStr{
"status_code": response.StatusCode,
"phrase": phrase,
"headers": m.getHeaders(response.Header),
"code": response.StatusCode,
"phrase": phrase,
"headers": m.getHeaders(response.Header),
},
}
}
Expand Down

0 comments on commit 12fae93

Please sign in to comment.