From 48e0660ff060ed1f74f8d29eea093fa0779f1fb4 Mon Sep 17 00:00:00 2001 From: Ishleen Kaur <102962586+ishleenk17@users.noreply.github.com> Date: Fri, 3 Nov 2023 10:23:20 +0530 Subject: [PATCH] Region and zone ecs fields nested in cloud field (#37015) --- CHANGELOG.next.asciidoc | 1 + x-pack/metricbeat/module/gcp/compute/_meta/data.json | 6 +++--- x-pack/metricbeat/module/gcp/compute/_meta/data_cpu.json | 6 +++--- x-pack/metricbeat/module/gcp/compute/_meta/data_disk.json | 6 +++--- .../metricbeat/module/gcp/compute/_meta/data_firewall.json | 6 +++--- x-pack/metricbeat/module/gcp/compute/_meta/data_memory.json | 6 +++--- .../metricbeat/module/gcp/compute/_meta/data_network.json | 6 +++--- .../metricbeat/module/gcp/timeseries_metadata_collector.go | 4 ++-- 8 files changed, 21 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 35ff7048e39..04e3f4c6a3c 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -150,6 +150,7 @@ is collected by it. - Add log error when statsd server fails to start {pull}36477[36477] - Fix CassandraConnectionClosures metric configuration {pull}34742[34742] - Fix event mapping implementation for statsd module {pull}36925[36925] +- The region and availability_zone ecs fields nested within the cloud field. {pull}37015[37015] *Osquerybeat* diff --git a/x-pack/metricbeat/module/gcp/compute/_meta/data.json b/x-pack/metricbeat/module/gcp/compute/_meta/data.json index 6501dcdd721..d09355c0ecc 100644 --- a/x-pack/metricbeat/module/gcp/compute/_meta/data.json +++ b/x-pack/metricbeat/module/gcp/compute/_meta/data.json @@ -9,10 +9,10 @@ "id": "1113015278728017638", "name": "gke-apm-ci-k8s-cluster-pool-2-e8852348-58mx" }, - "provider": "gcp" + "provider": "gcp", + "availability_zone": "us-central1-a", + "region": "us-central1" }, - "cloud.availability_zone": "us-central1-c", - "cloud.region": "us-central1", "event": { "dataset": "gcp.compute", "duration": 115000, diff --git a/x-pack/metricbeat/module/gcp/compute/_meta/data_cpu.json b/x-pack/metricbeat/module/gcp/compute/_meta/data_cpu.json index c85a645fda9..2d079f9afd6 100644 --- a/x-pack/metricbeat/module/gcp/compute/_meta/data_cpu.json +++ b/x-pack/metricbeat/module/gcp/compute/_meta/data_cpu.json @@ -9,10 +9,10 @@ "id": "7206859884978665190", "name": "gke-apm-ci-k8s-cluster-pool-2-e8852348-rt8n" }, - "provider": "gcp" + "provider": "gcp", + "availability_zone": "us-central1-a", + "region": "us-central1" }, - "cloud.availability_zone": "us-central1-c", - "cloud.region": "us-central1", "event": { "dataset": "gcp.compute", "duration": 115000, diff --git a/x-pack/metricbeat/module/gcp/compute/_meta/data_disk.json b/x-pack/metricbeat/module/gcp/compute/_meta/data_disk.json index 21a6fff96e9..b2b1f8ff318 100644 --- a/x-pack/metricbeat/module/gcp/compute/_meta/data_disk.json +++ b/x-pack/metricbeat/module/gcp/compute/_meta/data_disk.json @@ -9,10 +9,10 @@ "id": "4281532529829668842", "name": "synthetics-service" }, - "provider": "gcp" + "provider": "gcp", + "availability_zone": "us-central1-a", + "region": "us-central1" }, - "cloud.availability_zone": "us-central1-a", - "cloud.region": "us-central1", "event": { "dataset": "gcp.compute", "duration": 115000, diff --git a/x-pack/metricbeat/module/gcp/compute/_meta/data_firewall.json b/x-pack/metricbeat/module/gcp/compute/_meta/data_firewall.json index 41d4aba9bf0..a300fc3de71 100644 --- a/x-pack/metricbeat/module/gcp/compute/_meta/data_firewall.json +++ b/x-pack/metricbeat/module/gcp/compute/_meta/data_firewall.json @@ -9,10 +9,10 @@ "id": "8825965883407652424", "name": "heartbeat-los-angeles" }, - "provider": "gcp" + "provider": "gcp", + "availability_zone": "us-west2-a", + "region": "us-west2-a" }, - "cloud.availability_zone": "us-west2-a", - "cloud.region": "us-west2", "event": { "dataset": "gcp.compute", "duration": 115000, diff --git a/x-pack/metricbeat/module/gcp/compute/_meta/data_memory.json b/x-pack/metricbeat/module/gcp/compute/_meta/data_memory.json index 0087177c935..92aeaa933a4 100644 --- a/x-pack/metricbeat/module/gcp/compute/_meta/data_memory.json +++ b/x-pack/metricbeat/module/gcp/compute/_meta/data_memory.json @@ -12,10 +12,10 @@ "machine": { "type": "e2-micro" }, - "provider": "gcp" + "provider": "gcp", + "availability_zone": "us-central1-a", + "region": "us-central1" }, - "cloud.availability_zone": "us-central1-a", - "cloud.region": "us-central1", "event": { "dataset": "gcp.compute", "duration": 115000, diff --git a/x-pack/metricbeat/module/gcp/compute/_meta/data_network.json b/x-pack/metricbeat/module/gcp/compute/_meta/data_network.json index 43dc23944c0..6b45f4c7ea3 100644 --- a/x-pack/metricbeat/module/gcp/compute/_meta/data_network.json +++ b/x-pack/metricbeat/module/gcp/compute/_meta/data_network.json @@ -9,10 +9,10 @@ "id": "1113015278728017638", "name": "gke-apm-ci-k8s-cluster-pool-2-e8852348-58mx" }, - "provider": "gcp" + "provider": "gcp", + "availability_zone": "us-central1-a", + "region": "us-central1" }, - "cloud.availability_zone": "us-central1-c", - "cloud.region": "us-central1", "event": { "dataset": "gcp.compute", "duration": 115000, diff --git a/x-pack/metricbeat/module/gcp/timeseries_metadata_collector.go b/x-pack/metricbeat/module/gcp/timeseries_metadata_collector.go index 559f6077c8e..c5a296a9656 100644 --- a/x-pack/metricbeat/module/gcp/timeseries_metadata_collector.go +++ b/x-pack/metricbeat/module/gcp/timeseries_metadata_collector.go @@ -62,12 +62,12 @@ func (s *StackdriverTimeSeriesMetadataCollector) Metadata(ctx context.Context, i } if availabilityZone != "" { - ecs[ECSCloud+"."+ECSCloudAvailabilityZone] = availabilityZone + _, _ = ecs.Put(ECSCloud+"."+ECSCloudAvailabilityZone, availabilityZone) // Get region name from availability zone name region := getRegionName(availabilityZone) if region != "" { - ecs[ECSCloud+"."+ECSCloudRegion] = region + _, _ = ecs.Put(ECSCloud+"."+ECSCloudRegion, region) } }