Installation

filter on results of subsearch for the second search

spicy
Path Finder

Hi

I am running into a problem when it come to subsearches. I want to use results from the first search to plug into the second search. The uid/keyvalue  ties multiple sourcetypes together, with each sourcetype comes similar and unique information. It would be great to correlate this info by a table or stats. 

FYI

Both sourctypes have an uid field

dns sourcetype has the contains query field
conn sourcetype has the other fields wanting display

index="main" sourcetype=conn uid=keyvalue 

[ search index="main" sourcetype=dns
         | rename uid as keyvalue
          | table keyvalue]
| fields proto, query, id.orig_h
| table uid, query,  proto, id.orig_h

Labels (1)
0 Karma

ragedsparrow
Contributor

Have you looked into a `join` rather than a subsearch?  This is useful especially when you want to utilize data from both searches, correlated by a common field.  Subsearches tend to be more useful to filter the results of the main search based on the field values from the subsearch.

Reference Documentation: https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Join

0 Karma

spicy
Path Finder

Appreciate the help!

I worked on join too, but still no luck.  The biggest problem I think is using the tabled uid field from query1 then using it as a lookup in query2 (without creating a lookup).  if you have any suggested spl for me to try that would be great.

overview of the goal:

Sourctype DNS fields            Sourcetype Conn
uid, query                                    uid, src_ip, dest_ip

if (dnsuid = connuid)
then table uid, src_ip, dest_ip, query

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

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

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...