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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...