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!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk on November 6 at 11AM PT, and empower your SOC to reach new heights! Duration: ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...