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!

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...

Cloud Monitoring Console - Unlocking Greater Visibility in SVC Usage Reporting

For Splunk Cloud customers, understanding and optimizing Splunk Virtual Compute (SVC) usage and resource ...

Automatic Discovery Part 3: Practical Use Cases

If you’ve enabled Automatic Discovery in your install of the Splunk Distribution of the OpenTelemetry ...