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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...