Splunk Search

Spath and Rename

IRHM73
Motivator

Hi, I wonder whether someone may be able to help me please.

I'm trying to create a query which extracts given values using 'spath'.

This is what I've come up with so far:

| multisearch
[ search `cc-frontend_wmf(cCurrentYearIncome)`]
[ search `cc-frontend_wmf(pCurrentYearIncome)`]
| spath output=claimant path=detail.cCurrentYearIncome
| spath output=partner path=detail.pCurrentYearIncome

I can create the "claimant" and "partner" fields, but I then need to perform a rename and this is where I have the problem because the fields I need to rename have the same name as shown below.

field=claim need to rename currentIncome.employmentIncome as ccurrent
field=part need to rename currentIncome.employmentIncome as pcurrent

Could someone tell me please is there a way to differentiate the two fields ie. is there a way to rename when I create the spath?

Many thanks and kind regards

Chris

0 Karma
1 Solution

IRHM73
Motivator

Hi,

I've fixed the issue by using the following:

| spath output=current input=detail.cCurrentYearIncome path=currentIncome.employmentIncome
| spath output=pcurrent input=detail.pCurrentYearIncome path=currentIncome.employmentIncome

Many thanks

Chris

View solution in original post

IRHM73
Motivator

Hi,

I've fixed the issue by using the following:

| spath output=current input=detail.cCurrentYearIncome path=currentIncome.employmentIncome
| spath output=pcurrent input=detail.pCurrentYearIncome path=currentIncome.employmentIncome

Many thanks

Chris

Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...