Splunk Search

Output of search as input to another index

splunker_jim
Explorer

Hi there,

I have an computationally expensive query which is (manually) run on the main index. Instead of running it every time I would like to send the output of this search to another index where the output can be seen and further analysis can be done.

Is it possible to take the output of a search on one index, and feed it as input to another index? Can such a search be scheduled?

Many thanks !

jim

dmaislin_splunk
Splunk Employee
Splunk Employee

When you ran the first collect command did it complete? When you run the new command, did you select all-time? I just tried it without issue. You can ignore the informational messages.

splunker_jim
Explorer

Thanks for your quick response dmaislin !

Here is what I did:

  1. index=main source=blah | collect index=

I got the following messages in the message area (just below the search input area):

7,813 matching events
"Successfully wrote file to '1039324343_events.stash_new'."
"Changing file extension to .stash_new for file=$random$_events.stash"

Next, I did the following search

  1. index= In the search result pane, I see the following message:

"No matching events found"

In all of the above cases, the time range was set to 'All time'.

0 Karma

dmaislin_splunk
Splunk Employee
Splunk Employee

I think you can use the collect command to do just that.

splunker_jim
Explorer

Thanks for the quick response. I tried index=main | collect index=

I noticed some informational messages indicating that some temporary file(s) had been created.

However, if I do the following search
index=, I do not see any results.

It is as if the collect failed to add the search output into the other index.

I ensured that was already created before running any of the above commands. I used all default options when creating this index.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

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

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...