Skip to content

Commit

Permalink
Rename new field to azure.resourcegroup.name to align with otel
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelKatsoulis committed Mar 4, 2024
1 parent 9c7cd50 commit 0e08561
Show file tree
Hide file tree
Showing 20 changed files with 185 additions and 112 deletions.
30 changes: 19 additions & 11 deletions auditbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This document describes the fields that are exported by Auditbeat. They are
grouped in the following categories:
* <<exported-fields-auditd>>
* <<exported-fields-azure>>
* <<exported-fields-beat-common>>
* <<exported-fields-cloud>>
* <<exported-fields-common>>
Expand Down Expand Up @@ -2414,6 +2415,24 @@ type: geo_point
--
[[exported-fields-azure]]
== Azure Cloud provider metadata fields
Metadata from azure cloud providers added by the add_cloud_metadata processor.
*`azure.resourcegroup.name`*::
+
--
Name of resourceGroup the azure cloud instance belongs to.
type: keyword
--
[[exported-fields-beat-common]]
== Beat fields
Expand Down Expand Up @@ -2496,17 +2515,6 @@ example: ami-abcd1234
--
*`cloud.resource_group.name`*::
+
--
Name of resourceGroup the cloud instance belongs to.
type: keyword
--
*`meta.cloud.provider`*::
+
--
Expand Down
2 changes: 1 addition & 1 deletion auditbeat/include/fields.go

Large diffs are not rendered by default.

30 changes: 19 additions & 11 deletions filebeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ grouped in the following categories:
* <<exported-fields-aws-cloudwatch>>
* <<exported-fields-awsfargate>>
* <<exported-fields-azure>>
* <<exported-fields-azure>>
* <<exported-fields-barracuda>>
* <<exported-fields-beat-common>>
* <<exported-fields-bluecoat>>
Expand Down Expand Up @@ -2126,6 +2127,24 @@ Fields from Amazon ECS Fargate logs.
Fields for Amazon Fargate container logs.


[[exported-fields-azure]]
== Azure Cloud provider metadata fields

Metadata from azure cloud providers added by the add_cloud_metadata processor.




*`azure.resourcegroup.name`*::
+
--
Name of resourceGroup the azure cloud instance belongs to.


type: keyword

--

[[exported-fields-azure]]
== Azure fields

Expand Down Expand Up @@ -27699,17 +27718,6 @@ example: ami-abcd1234

--


*`cloud.resource_group.name`*::
+
--
Name of resourceGroup the cloud instance belongs to.


type: keyword

--

*`meta.cloud.provider`*::
+
--
Expand Down
2 changes: 1 addition & 1 deletion filebeat/include/fields.go

Large diffs are not rendered by default.

30 changes: 19 additions & 11 deletions heartbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ This file is generated! See _meta/fields.yml and scripts/generate_fields_docs.py
This document describes the fields that are exported by Heartbeat. They are
grouped in the following categories:
* <<exported-fields-azure>>
* <<exported-fields-beat-common>>
* <<exported-fields-browser>>
* <<exported-fields-cloud>>
Expand All @@ -36,6 +37,24 @@ grouped in the following categories:
* <<exported-fields-tls>>
--
[[exported-fields-azure]]
== Azure Cloud provider metadata fields
Metadata from azure cloud providers added by the add_cloud_metadata processor.
*`azure.resourcegroup.name`*::
+
--
Name of resourceGroup the azure cloud instance belongs to.
type: keyword
--
[[exported-fields-beat-common]]
== Beat fields
Expand Down Expand Up @@ -258,17 +277,6 @@ example: ami-abcd1234
--
*`cloud.resource_group.name`*::
+
--
Name of resourceGroup the cloud instance belongs to.
type: keyword
--
*`meta.cloud.provider`*::
+
--
Expand Down
2 changes: 1 addition & 1 deletion heartbeat/include/fields.go

Large diffs are not rendered by default.

22 changes: 13 additions & 9 deletions libbeat/processors/add_cloud_metadata/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@
example: ami-abcd1234
description: >
Image ID for the cloud instance.
- name: cloud.resource_group
default_field: true
type: group
fields:
- name: name
type: keyword
description: >
Name of resourceGroup the cloud instance belongs to.
# Alias for old fields
- name: meta.cloud.provider
default_field: true
Expand Down Expand Up @@ -59,5 +51,17 @@
type: alias
path: cloud.region
migration: true

- key: azure
title: Azure Cloud provider metadata
description: >
Metadata from azure cloud providers added by the add_cloud_metadata processor.
fields:
- name: azure.resourcegroup
default_field: true
type: group
fields:
- name: name
type: keyword
description: >
Name of resourceGroup the azure cloud instance belongs to.
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,15 @@ _Azure Virtual Machine_
[source,json]
-------------------------------------------------------------------------------
{
"azure": {
"resourcegroup.name": "/subscriptions/641ebacb-7743-41e7-b4fa-af1167351a61/resourcegroups/testgroup/providers/Microsoft.ContainerService/managedClusters/testcluster"
},
"cloud": {
"provider": "azure",
"instance.id": "04ab04c3-63de-4709-a9f9-9ab8c0411d5e",
"instance.name": "test-az-vm",
"machine.type": "Standard_D3_v2",
"region": "eastus2",
"resource_group.name": "/subscriptions/641ebacb-7743-41e7-b4fa-af1167351a61/resourcegroups/testgroup/providers/Microsoft.ContainerService/managedClusters/testcluster"
"region": "eastus2"
}
}
-------------------------------------------------------------------------------
Expand Down
11 changes: 7 additions & 4 deletions libbeat/processors/add_cloud_metadata/provider_azure_vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ var azureVMMetadataFetcher = provider{
azHeaders := map[string]string{"Metadata": "true"}
azHttpSchema := func(m map[string]interface{}) mapstr.M {
m["serviceName"] = "Virtual Machines"
out, _ := s.Schema{
cloud, _ := s.Schema{
"account": s.Object{
"id": c.Str("subscriptionId"),
},
Expand All @@ -84,11 +84,14 @@ var azureVMMetadataFetcher = provider{
"name": c.Str("serviceName"),
},
"region": c.Str("location"),
"resource_group": s.Object{
}.Apply(m)

azure, _ := s.Schema{
"resourcegroup": s.Object{
"name": c.Str("resourceGroupName"),
},
}.Apply(m)
return mapstr.M{"cloud": out}
return mapstr.M{"cloud": cloud, "azure": azure}
}

azGenSchema := func(m map[string]interface{}) mapstr.M {
Expand Down Expand Up @@ -186,7 +189,7 @@ func (az *azureMetadataFetcher) fetchAzureClusterMeta(
) {
logger := logp.NewLogger("add_cloud_metadata")
subscriptionId, _ := az.httpMeta.GetValue("cloud.account.id")
resourceGroupName, _ := az.httpMeta.GetValue("cloud.resource_group.name")
resourceGroupName, _ := az.httpMeta.GetValue("azure.resourcegroup.name")
strResourceGroupName := ""
if val, ok := resourceGroupName.(string); ok {
strResourceGroupName = val
Expand Down
30 changes: 19 additions & 11 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ grouped in the following categories:
* <<exported-fields-aws>>
* <<exported-fields-awsfargate>>
* <<exported-fields-azure>>
* <<exported-fields-azure>>
* <<exported-fields-beat-common>>
* <<exported-fields-beat>>
* <<exported-fields-ceph>>
Expand Down Expand Up @@ -5609,6 +5610,24 @@ type: long

--

[[exported-fields-azure]]
== Azure Cloud provider metadata fields

Metadata from azure cloud providers added by the add_cloud_metadata processor.




*`azure.resourcegroup.name`*::
+
--
Name of resourceGroup the azure cloud instance belongs to.


type: keyword

--

[[exported-fields-azure]]
== Azure fields

Expand Down Expand Up @@ -10095,17 +10114,6 @@ example: ami-abcd1234

--


*`cloud.resource_group.name`*::
+
--
Name of resourceGroup the cloud instance belongs to.


type: keyword

--

*`meta.cloud.provider`*::
+
--
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/include/fields/fields.go

Large diffs are not rendered by default.

30 changes: 19 additions & 11 deletions packetbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This document describes the fields that are exported by Packetbeat. They are
grouped in the following categories:
* <<exported-fields-amqp>>
* <<exported-fields-azure>>
* <<exported-fields-beat-common>>
* <<exported-fields-cassandra>>
* <<exported-fields-cloud>>
Expand Down Expand Up @@ -441,6 +442,24 @@ type: keyword
Creating application id.
type: keyword
--
[[exported-fields-azure]]
== Azure Cloud provider metadata fields
Metadata from azure cloud providers added by the add_cloud_metadata processor.
*`azure.resourcegroup.name`*::
+
--
Name of resourceGroup the azure cloud instance belongs to.
type: keyword
--
Expand Down Expand Up @@ -1284,17 +1303,6 @@ example: ami-abcd1234
--
*`cloud.resource_group.name`*::
+
--
Name of resourceGroup the cloud instance belongs to.
type: keyword
--
*`meta.cloud.provider`*::
+
--
Expand Down
2 changes: 1 addition & 1 deletion packetbeat/include/fields.go

Large diffs are not rendered by default.

30 changes: 19 additions & 11 deletions winlogbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ This file is generated! See _meta/fields.yml and scripts/generate_fields_docs.py
This document describes the fields that are exported by Winlogbeat. They are
grouped in the following categories:
* <<exported-fields-azure>>
* <<exported-fields-beat-common>>
* <<exported-fields-cloud>>
* <<exported-fields-docker-processor>>
Expand All @@ -29,6 +30,24 @@ grouped in the following categories:
* <<exported-fields-winlog>>
--
[[exported-fields-azure]]
== Azure Cloud provider metadata fields
Metadata from azure cloud providers added by the add_cloud_metadata processor.
*`azure.resourcegroup.name`*::
+
--
Name of resourceGroup the azure cloud instance belongs to.
type: keyword
--
[[exported-fields-beat-common]]
== Beat fields
Expand Down Expand Up @@ -111,17 +130,6 @@ example: ami-abcd1234
--
*`cloud.resource_group.name`*::
+
--
Name of resourceGroup the cloud instance belongs to.
type: keyword
--
*`meta.cloud.provider`*::
+
--
Expand Down
2 changes: 1 addition & 1 deletion winlogbeat/include/fields.go

Large diffs are not rendered by default.

Loading

0 comments on commit 0e08561

Please sign in to comment.