Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure Platform Logs: rename identity as identity_name when the value is a string #4629

Merged
merged 2 commits into from Nov 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/azure/changelog.yml
@@ -1,3 +1,8 @@
- version: "1.5.5"
changes:
- description: Rename identity as identity_name when the value is a string
type: bugfix
link: https://github.com/elastic/integrations/pull/4629
- version: "1.5.4"
changes:
- description: Enable Event Hub integration by default and improve documentation
Expand Down
@@ -0,0 +1 @@
{"Cloud":"AzureCloud","Environment":"prod","category":"kube-audit","ccpNamespace":"5e4bf4baee195b00017cdbfa","operationName":"Microsoft.ContainerService/managedClusters/diagnosticLogs/Read","identity":"Michael Dell","properties":{"log":"{\"kind\":\"Event\",\"apiVersion\":\"audit.k8s.io/v1\",\"level\":\"Metadata\",\"auditID\":\"22af12c3-a1fe-4f2c-99a9-3cdde671dbfe\"}","pod":"kube-apiserver-666bd4b459-hjgdc","stream":"stdout"},"resourceId":"/SUBSCRIPTIONS/70BD6E77-4B1E-4835-8896-DB77B8EEF364/RESOURCEGROUPS/OBS-INFRASTRUCTURE/PROVIDERS/MICROSOFT.CONTAINERSERVICE/MANAGEDCLUSTERS/OBSKUBE","time":"2020-11-09T10:57:31.0000000Z"}
@@ -0,0 +1,49 @@
{
"expected": [
{
"@timestamp": "2020-11-09T10:57:31.000Z",
"azure": {
"platformlogs": {
"Cloud": "AzureCloud",
"Environment": "prod",
"category": "kube-audit",
"ccpNamespace": "5e4bf4baee195b00017cdbfa",
"event_category": "Administrative",
"identity_name": "Michael Dell",
"operation_name": "Microsoft.ContainerService/managedClusters/diagnosticLogs/Read",
"properties": {
"log": {
"apiVersion": "audit.k8s.io/v1",
"auditID": "22af12c3-a1fe-4f2c-99a9-3cdde671dbfe",
"kind": "Event",
"level": "Metadata"
},
"pod": "kube-apiserver-666bd4b459-hjgdc",
"stream": "stdout"
}
},
"resource": {
"group": "OBS-INFRASTRUCTURE",
"id": "/SUBSCRIPTIONS/70BD6E77-4B1E-4835-8896-DB77B8EEF364/RESOURCEGROUPS/OBS-INFRASTRUCTURE/PROVIDERS/MICROSOFT.CONTAINERSERVICE/MANAGEDCLUSTERS/OBSKUBE",
"name": "OBSKUBE",
"provider": "MICROSOFT.CONTAINERSERVICE/MANAGEDCLUSTERS"
},
"subscription_id": "70BD6E77-4B1E-4835-8896-DB77B8EEF364"
},
"cloud": {
"provider": "azure"
},
"ecs": {
"version": "8.0.0"
},
"event": {
"action": "Microsoft.ContainerService/managedClusters/diagnosticLogs/Read",
"kind": "event",
"original": "{\"Cloud\":\"AzureCloud\",\"Environment\":\"prod\",\"category\":\"kube-audit\",\"ccpNamespace\":\"5e4bf4baee195b00017cdbfa\",\"operationName\":\"Microsoft.ContainerService/managedClusters/diagnosticLogs/Read\",\"identity\":\"Michael Dell\",\"properties\":{\"log\":\"{\\\"kind\\\":\\\"Event\\\",\\\"apiVersion\\\":\\\"audit.k8s.io/v1\\\",\\\"level\\\":\\\"Metadata\\\",\\\"auditID\\\":\\\"22af12c3-a1fe-4f2c-99a9-3cdde671dbfe\\\"}\",\"pod\":\"kube-apiserver-666bd4b459-hjgdc\",\"stream\":\"stdout\"},\"resourceId\":\"/SUBSCRIPTIONS/70BD6E77-4B1E-4835-8896-DB77B8EEF364/RESOURCEGROUPS/OBS-INFRASTRUCTURE/PROVIDERS/MICROSOFT.CONTAINERSERVICE/MANAGEDCLUSTERS/OBSKUBE\",\"time\":\"2020-11-09T10:57:31.0000000Z\"}"
},
"tags": [
"preserve_original_event"
]
}
]
}
Expand Up @@ -54,6 +54,12 @@ processors:
field: tags
value: ["preserve_original_event"]
ignore_failure: true
- rename:
field: azure.platformlogs.identity
if: "ctx.azure?.platformlogs?.identity instanceof String"
target_field: azure.platformlogs.identity_name
ignore_missing: true
description: 'Rename the field to `identity_name` to avoid conflicts with the `identity` containing a JSON object.'
- date:
field: azure.platformlogs.time
target_field: '@timestamp'
Expand Down
4 changes: 4 additions & 0 deletions packages/azure/data_stream/platformlogs/fields/fields.yml
Expand Up @@ -66,6 +66,10 @@
description: >
ActivityId

- name: identity_name
type: keyword
description: |
Identity name
- name: properties
type: flattened
description: |-
Expand Down
1 change: 1 addition & 0 deletions packages/azure/docs/platformlogs.md
Expand Up @@ -146,6 +146,7 @@ An example event for `platformlogs` looks as following:
| azure.platformlogs.category | Category | keyword |
| azure.platformlogs.ccpNamespace | ccpNamespace | keyword |
| azure.platformlogs.event_category | Event Category | keyword |
| azure.platformlogs.identity_name | Identity name | keyword |
| azure.platformlogs.operation_name | Operation name | keyword |
| azure.platformlogs.properties | Event properties | flattened |
| azure.platformlogs.result_description | Result description | keyword |
Expand Down
2 changes: 1 addition & 1 deletion packages/azure/manifest.yml
@@ -1,6 +1,6 @@
name: azure
title: Azure Logs
version: 1.5.4
version: 1.5.5
release: ga
description: This Elastic integration collects logs from Azure
type: integration
Expand Down