Hello,
How do i parse the values from the raw log which is viewed in a JSON format into a code snippet whether the value is a top level or nested?
In the example -
{
"textPayload": " customer: 12345,",
"insertId": "avhvhjmk",
"resource": {
"type": "k8s_container",
"labels": {
"cluster_name": "test-gke",
"project_id": "project-gke",
"location": "me-west1",
"container_name": "test-container",
"namespace_name": "default",
"pod_name": ”test-pod"
}
},
"timestamp": "2025-01-07T13:29:46.060650557Z",
"severity": "INFO",
"labels": {
"k8s-pod/app": "test-app",
"k8s-pod/pod-template-hash": "513gvhcd",
"compute.googleapis.com/resource_name": "test-gke-pool"
},
"logName": "projects/project-gke/logs/stdout",
"receiveTimestamp": "2025-01-07T13:29:46.193718123Z"
}
I’d like to convert the “location” field into the udm.target.location.name value, “severity” field into the udm.principal.security_result.severity_details value, and the “k8s-pod/app” field into the udm.principal.application value.
How can I do this?
Thank you!