From feec70a2afc8706a2c096d3e093f5821b82e8618 Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Tue, 13 Oct 2020 17:30:10 -0600 Subject: [PATCH 1/2] Add cloud.account.id into add_cloud_metadata for gcp --- libbeat/processors/add_cloud_metadata/provider_google_gce.go | 3 +++ .../processors/add_cloud_metadata/provider_google_gce_test.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/libbeat/processors/add_cloud_metadata/provider_google_gce.go b/libbeat/processors/add_cloud_metadata/provider_google_gce.go index 0fe69e1998d4..c17c1dfe2bd1 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 eccc07d4b30d..0c810fe7a291 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", From 3ff9bf62b3c41fc0c6e1353d4f8e5a7e6f52b066 Mon Sep 17 00:00:00 2001 From: kaiyan-sheng Date: Tue, 13 Oct 2020 17:32:55 -0600 Subject: [PATCH 2/2] add changelog --- CHANGELOG.next.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 41de16190a81..6f7c05fb9914 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -459,6 +459,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - 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] *Auditbeat*