Splunk Search

How to pass data from a report to another report?

LearningGuy
Motivator

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 (3)
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
Motivator

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!

Shape the Future of Splunk: Join the Product Research Lab!

Join the Splunk Product Research Lab and connect with us in the Slack channel #product-research-lab to get ...

Auto-Injector for Everything Else: Making OpenTelemetry Truly Universal

You might have seen Splunk’s recent announcement about donating the OpenTelemetry Injector to the ...

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...