Dashboards & Visualizations

How can I dynamically set the path parameter to an spath command?

afleet
New Member

Hi - depending on a previously set value, I'd like to dynamically retrieve a different path in an spath command.

For instance:

| spath input=message path=salesOrderLineItems{} output=items1
| spath input=message path="salesOrderLineItems{}" output=items2
| eval pathDynamic="salesOrderLineItems{}"
| spath input=message path=pathDynamic output=items3
| table items1, items2, items3

items1 and items2 are populated with a json structure, but items3 returns as null

I'd be grateful if someone can confirm if/how this can be done.
Thanks.

0 Karma
Get Updates on the Splunk Community!

The Payment Operations Wake-Up Call: Why Financial Institutions Can't Afford ...

The same scenario plays out across financial institutions daily. A payment system fails at 11:30 AM on a busy ...

Make Your Case: A Ready-to-Send Letter for Getting Approval to Attend .conf25

Hello Splunkers, Want to attend .conf25 in Boston this year but not sure how to convince your manager? We've ...

Community Spotlight: A Splunk Expert's Journey

In the world of data analytics, some journeys leave a lasting impact not only on the individual but on the ...