Splunk Search

How to invoke SPL from a field?

schose
Builder

Hi all,

I' searching for a possibility to invoke SPL from a field. Background: I want to dynamically display tables columns. I am getting the correct format from a lookup where the field "spl" contains the output like "table host source sourcetype"

index=summary | lookup formatting.csv matchhost as host | invoke(spl)

Is there a possibility to execute spl coming from a field?

Thanks for your help in advance,

Andreas

Tags (4)
0 Karma
1 Solution

goelli
Communicator

I think you want to sort the order of the fields in a table based on which savedsearch the events are from. For this you need to search for a specific saved_search. Then you have a lookup with a 1:1 connection between savedsearch and format. If this is true, try the following:

index=summary search_name="your_saved_search"
| table
[ | inputlookup formatting.csv
| search search_name="your_saved_search"
| fields format
| rename format as search ]

Background for this is, that a field named "search" from a subsearch is interpreted as SPL in the base search.

View solution in original post

goelli
Communicator

I think you want to sort the order of the fields in a table based on which savedsearch the events are from. For this you need to search for a specific saved_search. Then you have a lookup with a 1:1 connection between savedsearch and format. If this is true, try the following:

index=summary search_name="your_saved_search"
| table
[ | inputlookup formatting.csv
| search search_name="your_saved_search"
| fields format
| rename format as search ]

Background for this is, that a field named "search" from a subsearch is interpreted as SPL in the base search.

schose
Builder

Hi,

Well, I'd like to create a certain dashboard: maybe I need to tell more about the background: I want to store the result of an alert for later viewing. All alerts table out their results out in a different way. First idea is to use summary indexes for storing the results.
Unfurtunatly in the summary index the table columns are reordered alphabetically.

For later viewing I want to create a dashboard which calls the Summaryindex and table out the result. As the resulttable is dynamically i like to interpret spl which is coming from the lookup.

If this is not possible - i guess i've seen it somewhere in the past - im may have to create a custom alert action, but i want to use less custom code as possible.

Regards,

Andreas

0 Karma

DalJeanis
Legend

It sounds like you are building a dashboard, so you want to link from a field to a drilldown search.

This is a standard feature.

Here's how to link to a search:

https://docs.splunk.com/Documentation/Splunk/7.0.2/Viz/DrilldownLinkToSearch

here's how to link to a separate dashboard:

https://docs.splunk.com/Documentation/Splunk/7.0.2/Viz/DrilldownLinkToDashboard

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

SOK it to Me: Top 3 Benefits of Using Splunk Operator on Kubernetes that’ll Make ...

    Thursday, July 9, 2026  |  11:00AM–12:00PM PDT Duration: 1 hour (includes Q&A) Managing can feel like a ...

Upgrade Prep for 10.4, Network Observability Deep Dives, and More from Splunk Lantern

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...

Splunk Developer Day announcements: AI agents, MCP tools, Forecasting, and Custom ...

Splunk Developer Day was packed with product and platform updates for developers building in the AI ...