Skip to content

Commit

Permalink
Change field type of http header from nested to object
Browse files Browse the repository at this point in the history
The field type of http headers was set to nested instead of object. In metricbeat we normally do not used nested fields. Also nested fields are not compatible with the sorting on index time feature coming in 6.0.

The problem with indexing the headers is that it could lead to field explosion if there are many different headers. An alternative would be to not index the headers. For now my recommendation is if someone has too many headers, filters should be used to remove most of the entries before it is sent to Elasticsearch.
  • Loading branch information
ruflin committed Sep 28, 2017
1 parent 0b104ff commit 8c0857c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ https://github.com/elastic/beats/compare/v6.0.0-beta2...master[Check the HEAD di
- Fix kubernetes events module to be able to index time fields properly. {issue}5093[5093]
- The MongoDB module now connects on each fetch, to avoid stopping the whole Metricbeat instance if MongoDB is not up when starting. {pull}5120[5120]
- Fixed `cmd_set` and `cmd_get` being mixed in the Memcache module. {pull}5189[5189]
- Change field type of http header from nested to object {pull}5258[5258]

*Packetbeat*

Expand Down
4 changes: 2 additions & 2 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4039,7 +4039,7 @@ HTTP request information
[float]
=== `http.request.header`
type: nested
type: object
The HTTP headers sent
Expand Down Expand Up @@ -4070,7 +4070,7 @@ HTTP response information
[float]
=== `http.response.header`
type: nested
type: object
The HTTP headers received
Expand Down
2 changes: 2 additions & 0 deletions metricbeat/docs/modules/http.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ This module is inspired by the Logstash https://www.elastic.co/guide/en/logstash

This is often necessary in security restricted network setups, where Logstash is not able to reach all servers. Instead the server to be monitored itself has Metricbeat installed and can send the data or a collector server has Metricbeat installed which is deployed in the secured network environment and can reach all servers to be monitored.

NOTE: As the HTTP mertricsets also fetch headers, this can lead to lots of fields in Elasticsearch in case there are many different headers. If this is the case for you and you don't need the headers, we recommend to use processors to filter out the header field.


[float]
=== Example configuration
Expand Down
2 changes: 2 additions & 0 deletions metricbeat/module/http/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ Multiple endpoints can be configured which are polled in a regular interval and
This module is inspired by the Logstash https://www.elastic.co/guide/en/logstash/current/plugins-inputs-http_poller.html[http_poller] input filter but doesn't require that the endpoint is reachable by Logstash as the Metricbeat module pushes the data to the configured output channels, e.g. Logstash or Elasticsearch.

This is often necessary in security restricted network setups, where Logstash is not able to reach all servers. Instead the server to be monitored itself has Metricbeat installed and can send the data or a collector server has Metricbeat installed which is deployed in the secured network environment and can reach all servers to be monitored.

NOTE: As the HTTP mertricsets also fetch headers, this can lead to lots of fields in Elasticsearch in case there are many different headers. If this is the case for you and you don't need the headers, we recommend to use processors to filter out the header field.
4 changes: 2 additions & 2 deletions metricbeat/module/http/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
HTTP request information
fields:
- name: header
type: nested
type: object
description: >
The HTTP headers sent
- name: method
Expand All @@ -30,7 +30,7 @@
HTTP response information
fields:
- name: header
type: nested
type: object
description: >
The HTTP headers received
- name: status_code
Expand Down

0 comments on commit 8c0857c

Please sign in to comment.