From f556a8a59b6e99fa766ce824da31126be5cdb6a5 Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Mon, 19 Oct 2020 07:01:30 -0600 Subject: [PATCH] Add cloud.account.id into add_cloud_metadata for gcp (#21776) (#21868) (cherry picked from commit 325ee323ce2a60e9b88d033aaf02aeab3fedc3f5) --- CHANGELOG.next.asciidoc | 1 + libbeat/processors/add_cloud_metadata/provider_google_gce.go | 3 +++ .../processors/add_cloud_metadata/provider_google_gce_test.go | 3 +++ 3 files changed, 7 insertions(+) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index a1ee0cdb47e..ea855b20057 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -530,6 +530,7 @@ field. You can revert this change by configuring tags for the module and omittin - Add istiod metricset. {pull}21519[21519] - Release `add_cloudfoundry_metadata` as GA. {pull}21525[21525] - Add support for OpenStack SSL metadata APIs in `add_cloud_metadata`. {pull}21590[21590] +- Add cloud.account.id for GCP into add_cloud_metadata processor. {pull}21776[21776] - Add proxy metricset for istio module. {pull}21751[21751] *Auditbeat* diff --git a/libbeat/processors/add_cloud_metadata/provider_google_gce.go b/libbeat/processors/add_cloud_metadata/provider_google_gce.go index 0fe69e1998d..c17c1dfe2bd 100644 --- a/libbeat/processors/add_cloud_metadata/provider_google_gce.go +++ b/libbeat/processors/add_cloud_metadata/provider_google_gce.go @@ -69,6 +69,9 @@ var gceMetadataFetcher = provider{ "project": s.Object{ "id": c.Str("projectId"), }, + "account": s.Object{ + "id": c.Str("projectId"), + }, }.ApplyTo(out, project) } diff --git a/libbeat/processors/add_cloud_metadata/provider_google_gce_test.go b/libbeat/processors/add_cloud_metadata/provider_google_gce_test.go index eccc07d4b30..0c810fe7a29 100644 --- a/libbeat/processors/add_cloud_metadata/provider_google_gce_test.go +++ b/libbeat/processors/add_cloud_metadata/provider_google_gce_test.go @@ -152,6 +152,9 @@ func TestRetrieveGCEMetadata(t *testing.T) { expected := common.MapStr{ "cloud": common.MapStr{ + "account": common.MapStr{ + "id": "test-dev", + }, "provider": "gcp", "instance": common.MapStr{ "id": "3910564293633576924",