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!

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...