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!

AppDynamics Summer Webinars

This summer, our mighty AppDynamics team is cooking up some delicious content on YouTube Live to satiate your ...

SOCin’ it to you at Splunk University

Splunk University is expanding its instructor-led learning portfolio with dedicated Security tracks at .conf25 ...

Credit Card Data Protection & PCI Compliance with Splunk Edge Processor

Organizations handling credit card transactions know that PCI DSS compliance is both critical and complex. The ...