Splunk Search

How to build and execute SPL based on records fetched from each row of lookup file?

Taruchit
Contributor

Hello All,

I have a lookup file: table1.csv with two columns: index, sourcetype.

I have a custom index which has fields: orig_index, orig_sourcetype

I need to build and execute an SPL for each row of the lookup file.

Thus, need your inputs to build the same.

Thank you

Taruchit

 

Labels (3)
0 Karma

Taruchit
Contributor

I tried to build below SPL so far:-

|inputlookup table1.csv |table index, sourcetype 
|eval key="index=custom_index orig_index=".index." orig_sourcetype=".sourcetype."
| timechart span=1d avg(event_count) AS avg_event_count 
|predict avg_event_count future_timespan=1 
|tail 1
| fields prediction(avg_event_count)"

With above SPL, I get three columns: index, sourcetype and key.

In column key, I get the corresponding SPL of the row. Thus, I need help to execute and generate results for each row.

Thank you

0 Karma
Get Updates on the Splunk Community!

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...