Splunk Search

How to extract all the values from a field and use it in a search?

alan20854
Path Finder

Hi,

I am currently trying to find all the events that contain the phrase "ERROR" and based on their IDs, I want to see if those IDs are able to continue in the application.

Right now, I have this as my search, but it seems to only find the first error and returns that ID, only searching through that ID for the phrase "module completed":

host=... source=...  [search "ERROR" |  return ID] "modules completed:"

I would like the search to iterate through every ID that contains "ERROR" and look for "modules completed" within each of those IDs. Is there a way to do this?

Thanks

0 Karma
1 Solution

javiergn
Super Champion

First of all, take a look at how subsearches work and the limitations:

https://docs.splunk.com/Documentation/Splunk/6.4.1/SearchTutorial/Useasubsearch
https://docs.splunk.com/Documentation/Splunk/6.4.1/Search/Aboutsubsearches

Having said that, give this a try:

host=... source=...  "modules completed:" [search "ERROR" |  table ID] 

Keep in mind if you are returning thousands of IDs your search is going to be veeery slow and not great from performance point of view.

View solution in original post

0 Karma

rphillips_splk
Splunk Employee
Splunk Employee

@alan20854 can you paste a sample of your events to your question above?

0 Karma

javiergn
Super Champion

First of all, take a look at how subsearches work and the limitations:

https://docs.splunk.com/Documentation/Splunk/6.4.1/SearchTutorial/Useasubsearch
https://docs.splunk.com/Documentation/Splunk/6.4.1/Search/Aboutsubsearches

Having said that, give this a try:

host=... source=...  "modules completed:" [search "ERROR" |  table ID] 

Keep in mind if you are returning thousands of IDs your search is going to be veeery slow and not great from performance point of view.

0 Karma

alan20854
Path Finder

Thanks javiergn, I appreciate the help!

0 Karma
Get Updates on the Splunk Community!

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...