Splunk Search

How do I rename a nested field?

stong2351
New Member

I have an eval query.

The details object returned looks like this:
{
status: 404,
code: ERROR
}


"details.status"=404 | eval detailsStatus=details.status | table detailsStatus

detailsStatus never has a value in the table though. What am I doing wrong?

Tags (3)
0 Karma

kjvarga
Observer

Using eval and single quotes worked for me, for example: 

namespace="production" container_name="payment-service" type="event" data.event="setup_intent.setup_failed" | eval userId = 'data.event_data.data.object.metadata.user_id' | table userId
0 Karma

richgalloway
SplunkTrust
SplunkTrust

I've done that before, but don't recall if I used |eval detailsStatus = "details.status", | eval detailsStatus = 'details.status', or | rename "details.stats" as detailsStatus. Perhaps one of them will work for you.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Now Available: Cisco Talos Threat Intelligence Integrations for Splunk Security Cloud ...

At .conf24, we shared that we were in the process of integrating Cisco Talos threat intelligence into Splunk ...

Preparing your Splunk Environment for OpenSSL3

The Splunk platform will transition to OpenSSL version 3 in a future release. Actions are required to prepare ...

Easily Improve Agent Saturation with the Splunk Add-on for OpenTelemetry Collector

Agent Saturation What and Whys In application performance monitoring, saturation is defined as the total load ...