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!

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...

Adoption of Infrastructure Monitoring at Splunk

  Splunk's Growth Engineering team showcases one of their first Splunk product adoption-Splunk Infrastructure ...

Modern way of developing distributed application using OTel

Recently, I had the opportunity to work on a complex microservice using Spring boot and Quarkus to develop a ...