Splunk Search

How to send a calculated multivalued field from a search as an input to another search

kiru2992
Path Finder

Hello Everyone!

I have a scenario to extract a particular set id's from index1 in search1 and run a search2 on index2 based on the extracted ids.

Example :

Search1:

index="index1" sourcetype="st1" field1="abc"

|rename id as ticket_id

Search2:

index="index2" source="xyz"

| sort 0 ticket_id

|.........

What's the best way to go about it? I tried using map but I've had no luck at all. Not sure if it's because I'm using it wrong or if it's not appropriate for the situation. Including both indexes at the start of the search is not feasible given the absurd size of the second index.

Can anyone please help me here?

Thank you in advance.

 

Labels (2)
Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

If the number of results from search 1 is fewer than 10,000 then you can use a subsearch.

index="index2" source="xyz" [ index="index1" sourcetype="st1" field1="abc"
|rename id as ticket_id | fields ticket_id | format ]
| sort 0 ticket_id
|.........
---
If this reply helps you, Karma would be appreciated.
0 Karma

kiru2992
Path Finder

Thank you for your reply. May I know why this is limited to 10,000.

0 Karma

richgalloway
SplunkTrust
SplunkTrust
It is a limit imposed by Splunk for reasons known only to them. See https://docs.splunk.com/Documentation/Splunk/8.0.5/Search/Aboutsubsearches#Output_settings_for_subse...
---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...