Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i5354: Harmonize field names between Packetbeat HTTP and Metricbeat Module #5521

Merged
merged 1 commit into from
Nov 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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