Dashboards & Visualizations

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

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.

0 Karma
Get Updates on the Splunk Community!

Splunk Forwarders and Forced Time Based Load Balancing

Splunk customers use universal forwarders to collect and send data to Splunk. A universal forwarder can send ...

NEW! Log Views in Splunk Observability Dashboards Gives Context From a Single Page

Today, Splunk Observability releases log views, a new feature for users to add their logs data from Splunk Log ...

Last Chance to Submit Your Paper For BSides Splunk - Deadline is August 12th!

Hello everyone! Don't wait to submit - The deadline is August 12th! We have truly missed the community so ...