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!

Combine Multiline Logs into a Single Event with SOCK - a Guide for Advanced Users

This article is the continuation of the “Combine multiline logs into a single event with SOCK - a step-by-step ...

Everything Community at .conf24!

You may have seen mention of the .conf Community Zone 'round these parts and found yourself wondering what ...

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...