Splunk Search

Using the Output from a Search in One Index to Search in a Second Index

JoeHubner
Explorer

I am looking to search in one Index for a specific field name and then use a second field from that Index to search a second Index for that value.  For example

IndexA has field names Project and IRNumber / IndexB has a field named InternalRequest

IRNumber in Index A and InternalRequest in IndexB are the same values

I would like to search IndexA by Project and then use the associated IRNumber from IndexA to search IndexB for the InternalRequest with the same value and then table various values from IndexB associated with that InternalRequest value.  Is there some way to use a sub-search to do this?

Labels (1)
0 Karma
1 Solution

JoeHubner
Explorer

Worked like a charm.  Thanks for the assistance.

View solution in original post

0 Karma

JoeHubner
Explorer

Worked like a charm.  Thanks for the assistance.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

You can do this with subsearches either by adding the subsearch to the main search, or by using a join, or possibly using stats

For example:

index=B [| search index=A project=X | dedup IRNumber | rename IRNumber as InternalRequest | fields InternalRequest]

 

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

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...