Skip to content

Commit

Permalink
Add instance_name in GCE cloud processor (#4414)
Browse files Browse the repository at this point in the history
  • Loading branch information
BeLi4L authored and tsg committed May 30, 2017
1 parent 812f374 commit a248e8d
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ https://github.com/elastic/beats/compare/v6.0.0-alpha1...master[Check the HEAD d
- Added the possibility to set Elasticsearch mapping template settings from the Beat configuration file. {pull}4284[4284] {pull}4317[4317]
- Add a variable to the SysV init scripts to make it easier to change the user. {pull}4340[4340]
- Add the option to write the generated Elasticsearch mapping template into a file. {pull}4323[4323]
- Add instance_name in GCE add_cloud_metadata processor. {pull}4414[4414]

*Filebeat*
- Add experimental Redis slow log prospector type. {pull}4180[4180]
Expand Down
6 changes: 6 additions & 0 deletions filebeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,12 @@ Name of the cloud provider. Possible values are ec2, gce, or digitalocean.
Instance ID of the host machine.
[float]
=== meta.cloud.instance_name
Instance name of the host machine.
[float]
=== meta.cloud.machine_type
Expand Down
6 changes: 6 additions & 0 deletions heartbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ Name of the cloud provider. Possible values are ec2, gce, or digitalocean.
Instance ID of the host machine.
[float]
=== meta.cloud.instance_name
Instance name of the host machine.
[float]
=== meta.cloud.machine_type
Expand Down
4 changes: 4 additions & 0 deletions libbeat/processors/add_cloud_metadata/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
description: >
Instance ID of the host machine.
- name: meta.cloud.instance_name
description: >
Instance name of the host machine.
- name: meta.cloud.machine_type
example: t2.medium
description: >
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ func newGceMetadataFetcher(config common.Config) (*metadataFetcher, error) {
if instance, ok := m["instance"].(map[string]interface{}); ok {
s.Schema{
"instance_id": c.StrFromNum("id"),
"instance_name": c.Str("name"),
"machine_type": c.Str("machineType"),
"availability_zone": c.Str("zone"),
}.ApplyTo(out, instance)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const gceMetadataV1 = `{
}
],
"hostname": "test-gce-dev.c.test-dev.internal",
"name": "test-gce-dev",
"id": 3910564293633576924,
"image": "",
"licenses": [
Expand Down Expand Up @@ -137,6 +138,7 @@ func TestRetrieveGCEMetadata(t *testing.T) {
"cloud": common.MapStr{
"provider": "gce",
"instance_id": "3910564293633576924",
"instance_name": "test-gce-dev",
"machine_type": "projects/111111111111/machineTypes/f1-micro",
"availability_zone": "projects/111111111111/zones/us-east1-b",
"project_id": "test-dev",
Expand Down
6 changes: 6 additions & 0 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2663,6 +2663,12 @@ Name of the cloud provider. Possible values are ec2, gce, or digitalocean.
Instance ID of the host machine.
[float]
=== meta.cloud.instance_name
Instance name of the host machine.
[float]
=== meta.cloud.machine_type
Expand Down
6 changes: 6 additions & 0 deletions packetbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -1066,6 +1066,12 @@ Name of the cloud provider. Possible values are ec2, gce, or digitalocean.
Instance ID of the host machine.
[float]
=== meta.cloud.instance_name
Instance name of the host machine.
[float]
=== meta.cloud.machine_type
Expand Down
6 changes: 6 additions & 0 deletions winlogbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ Name of the cloud provider. Possible values are ec2, gce, or digitalocean.
Instance ID of the host machine.
[float]
=== meta.cloud.instance_name
Instance name of the host machine.
[float]
=== meta.cloud.machine_type
Expand Down

0 comments on commit a248e8d

Please sign in to comment.