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
StudentID | Name | GPA | Percentile | |
101 | Student1 | 4 | 100% | Student1@email.com |
102 | Student2 | 3 | 90% | Student2@email.com |
103 | Student3 | 2 | 70% | Student3@email.com |
104 | Student4 | 1 | 40% | Student4@email.com |
Report 2
StudentID | Course | Grade |
101 | Math | 100 |
101 | English | 95 |
102 | Math | 90 |
102 | English | 90 |
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.
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!!
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).