Splunk Search

How to correlate across events, then aggregate by a different event?

toehser1
New Member

Something like,

DEBUG traceid=123 user=john
DEBUG traceid=123 result=200
DEBUG traceid=456 user=john
DEBUG traceid=456 result=400
DEBUG traceid=789 user=sue
DEBUG traceid=789 result=200
DEBUG traceid=abc user=john
DEBUG traceid=abc result=200

I want to get:
John success 2 failure 1
sue success 1 failure 0

0 Karma
1 Solution

masonmorales
Influencer

Try this:

| stats values(user) as user, values(result) as result by traceid
| stats count(result="200") as "success", count(result!="200") as "failure" by user

View solution in original post

masonmorales
Influencer

Try this:

| stats values(user) as user, values(result) as result by traceid
| stats count(result="200") as "success", count(result!="200") as "failure" by user
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...