From 5617fd0f5c900951844cc9220ebdcb7a011c601b Mon Sep 17 00:00:00 2001 From: ishleenk17 Date: Wed, 1 Nov 2023 16:59:08 +0530 Subject: [PATCH] Region and zone ecs fields nested in cloud field --- 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 8ba973c8c63c..866ff4889b9b 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -136,6 +136,7 @@ is collected by it. - Add remaining dimensions for azure storage account to make them available for tsdb enablement. {pull}36331[36331] - Add missing 'TransactionType' dimension for Azure Storage Account. {pull}36413[36413] - Add log error when statsd server fails to start {pull}36477[36477] +- The region and availability_zone ecs fields nested within the cloud field. {pull}123[123] *Osquerybeat* diff --git a/x-pack/metricbeat/module/gcp/compute/_meta/data.json b/x-pack/metricbeat/module/gcp/compute/_meta/data.json index 6501dcdd721c..d09355c0ecc4 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 c85a645fda92..2d079f9afd6f 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 21a6fff96e99..b2b1f8ff3180 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 41d4aba9bf05..a300fc3de713 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 0087177c935b..92aeaa933a40 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 43dc23944c07..6b45f4c7ea33 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 559f6077c8e2..c5a296a96563 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) } }