Splunk Search

How to pass data from a report to another report?

LearningGuy
Builder

Hello,

How to pass data/token from a report to another report?   Thank you for your help
I am trying to run a weekly report that produces top 4 students (out of 100), then once I find out the top 4 students, I will run another report that provides detailed information about grades for those 4 students
For example:

Report 1

StudentIDNameGPAPercentileEmail
101Student14100%Student1@email.com
102Student2390%Student2@email.com
103Student3270%Student3@email.com
104Student4140%Student4@email.com


Report 2

StudentIDCourseGrade
101Math100
101English95
102Math90
102English90

 

Labels (4)
0 Karma

PickleRick
SplunkTrust
SplunkTrust

https://docs.splunk.com/Documentation/Splunk/9.1.3/Search/Aboutsubsearches

Watch out however because subsearches have their limitations so if your subsearch is either long-running or returns many events, it may get silently finalized and you might not get proper results (you might get wrong results or no results at all).

Question is whether you have this Report 1 anyway or is it just a part of the functionality you want to achieve because it might be probably done differently with just a single search.

LearningGuy
Builder

Hello,

I put Table 1 into CSV file called "StudentRank.csv" and tried to use subsearch, it didn't seem to work
See below:

index=student
[search | inputlookup StudentRank.csv | head 2 | table StudentID]

I also tried to use appendpipe or append, it worked but it showed all students in CSV table (4 student)
| append [ | inputlookup StudentRank.csv | head 2 | table StudentID]

My goal is similar to
| search StudentID=101    ..  repeat until StudentID=102     (N out of Total, in this example, 2 out of 4)

The second search is a lot of details
Is it possible to pass a token in a scheduled search like when pass a token from a dropdown selection box in Splunk dashboard?

Thank you!!

0 Karma

PickleRick
SplunkTrust
SplunkTrust

You didn't read the docs I pointed you to. Stitching your searches using random commands won't work.

Results from a subsearch are rendered as a set of conditions to the outer search - you don't pass argumenta/tokens/whatever to the subsearch from the outer search. (We'll leave the map command for now).

Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...