Splunk Search

How do I find transaction that does not contain an event?

vgodavarty0116
Engager

Hi I have a log like below.

x INFO id=abc123 Started Processing
x+1 INFO id=abc123 Ended Processing
x+2 INFO id=abc123 Notification Sent
x+3 INFO id=def456 Started Processing
x+4 INFO id=def456 Ended Processing


Now I want to find for which ids notifications are not sent ( a result in a table format  something like this)

id             Notification sent
abc123         yes
def456         no

I tried using "NOT" clause but unable to figure out the query to get the desired results. Can anyone please help me to figure out the query?!

Labels (4)
0 Karma
1 Solution

venkatasri
SplunkTrust
SplunkTrust

Hi @vgodavarty0116 

You can try this,

index=yout_index sourcetype=your_stype
| rex "id=\S+\s+(?<process_stage>[\w\s\d]+)" 
| stats values(process_stage) as vals by id 
| eval notification=if(mvcount(vals) == 3 AND match(vals,"Notification"), "Yes", "No") 
| table id notification

------

An upvote would be appreciated if it helps!

View solution in original post

venkatasri
SplunkTrust
SplunkTrust

Hi @vgodavarty0116 

You can try this,

index=yout_index sourcetype=your_stype
| rex "id=\S+\s+(?<process_stage>[\w\s\d]+)" 
| stats values(process_stage) as vals by id 
| eval notification=if(mvcount(vals) == 3 AND match(vals,"Notification"), "Yes", "No") 
| table id notification

------

An upvote would be appreciated if it helps!

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 ...