Splunk Search

Is it possible to run subsearch per each event?

gesman
Communicator

Is there a way to run custom subsearch per each event?
Pseudo: index=logs "error" | foreachevent [search index=extra_data | ... ] | ...
When few web hits within incoming traffic are red flagged - each such hit needs to be correlated with data at other indexes to enrich results with metadata.
Short of writing custom search command or forcing search query to generate another query dynamically - I don't know any more straightforward ways to make it happen.

Tags (1)
0 Karma

wpreston
Motivator

I think the map command is what you need. From the docs:

> Looping operator, performs a search over each search result

index=logs "error" | map search="search starttimeu::$start$ endtimeu::$end$" index=extra_data fieldIAmInterestedIn=$field$ | ... | stats over all results...

Try it out with an initial search that returns only a small amount of events first, as map can take quite a while to run if it has to run too many searches.

vganjare
Builder

Hi,

You can try the answer mentioned @ http://answers.splunk.com/answers/232781/find-all-events-of-type-x-that-do-not-have-an-even.html#ans...

Its possible to generate the dynamic query depending on subsearches.

Thanks!!

0 Karma
Get Updates on the Splunk Community!

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...