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
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...