Splunk Search

How can I search for the contents of a table inside of another table?

fre
Engager

Hi and thanks for reading in advance,

I have two tables:

  1. events for status=50* on a /submissions URL endpoint, let's call this errors, and
  2. events for status=200 on a /submissions URL endpoint, let's call this successes

I want to find out which events occur in the errors table, but not the successes table.

The particular context is we had an outage, and I'm trying to discover which events were successfully submitted at a later date, and mainly: which events haven't been submitted since the outage.

How would you go about this?

Thanks,
fre

Tags (2)
0 Karma
1 Solution

DalJeanis
Legend

It's going to be something like this, then...

 index=foo  status=50* OR status=200
 | fields status whateverfieldsareuniqueeventid
 | eval Result=if(status=200,"Success","Error")
 | stats values(Result) by whateverfieldsareuniqueeventid
 | where mvcount(Result)=1 AND Result="Error"

View solution in original post

0 Karma

DalJeanis
Legend

It's going to be something like this, then...

 index=foo  status=50* OR status=200
 | fields status whateverfieldsareuniqueeventid
 | eval Result=if(status=200,"Success","Error")
 | stats values(Result) by whateverfieldsareuniqueeventid
 | where mvcount(Result)=1 AND Result="Error"
0 Karma

somesoni2
Revered Legend

A sudo code will be like this (RESULT_TYPE_Identifier is field which differentiates errors with success)

(BASE SEARCH ERRORS) OR (BASE SEARCH SUCCESS) 
| eval RESULT_TYPE_Identifier=if(like(status,"50%"),"Error","Success")
| stats values(RESULT_TYPE_Identifier) as RESULT_TYPE_Identifier by eventIdentifier_field(s)
| where mvcount(RESULT_TYPE_Identifier)=1 AND RESULT_TYPE_Identifier="Error"

We can give you better suggestions if you could share your actual queries..

0 Karma

fre
Engager

Thanks somesoni2,
queries are quite simple, basically:

 status=50*

and

 status=200
0 Karma

somesoni2
Revered Legend

Do you have any unique identifier in your logs, kind of transaction id or event id?

0 Karma
Get Updates on the Splunk Community!

Splunk Enterprise Security(ES) 7.3 is approaching the end of support. Get ready for ...

Hi friends!    At Splunk, your product success is our top priority. With Enterprise Security (ES), we're here ...

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

Watch On Demand the Tech Talk, and empower your SOC to reach new heights! Duration: 1 hour  Prepare to ...

Splunk Observability for AI

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