Splunk Search

Finding multiple events for same user

ateterine
Path Finder

Ok, so title might not say exactly what I'm looking for but here is my scenario.

a. We have users who received error message
b. We have users who have signed_in field value set to 'y'

We need to find those users who have field_a value set to 'y' and received the error message.

The problem is that that signed_in field does not exist in error message.

Message 1 has these fields: user_id, signed_in (boolean value of 'y' or 'n')
Message 2 has these fields: user_id, error_description

I've tried using transactions, but with millions of events search takes forever.

A push in the right direction is appreciated.

Thanks

Tags (2)
0 Karma
1 Solution

Ayn
Legend

I would go with a subsearch:

<message2 search> [search <message1 search> | dedup user_id | fields user_id] | stats count by user_id

View solution in original post

0 Karma

Ayn
Legend

I would go with a subsearch:

<message2 search> [search <message1 search> | dedup user_id | fields user_id] | stats count by user_id
0 Karma

ateterine
Path Finder

I've tried that, but for some reason every time I run that search I get different numbers

earliest="11/16/2014:09:00:00" latest="11/16/2014:20:00:00" error_description="RequestUserLeagues - Could not obtain enabled leagues" [search fantasy_leagues=y | dedup user_id | fields user_id] | stats dc(user_id) 
0 Karma

ateterine
Path Finder

After cleaning up the search and referencing Splunk docs I got it working

earliest="11/16/2014:09:00:00" latest="11/16/2014:20:00:00"  error_description="*RequestUserLeagues - Could not obtain enabled leagues*" [search earliest="11/16/2014:09:00:00" latest="11/16/2014:20:00:00"  fantasy_leagues=y | dedup user_id | fields user_id] | stats dc(user_id) as UsersWithIncorrectMessage
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

 Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What's New in Splunk Observability - August 2025

What's New We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what is ...

Introduction to Splunk AI

How are you using AI in Splunk? Whether you see AI as a threat or opportunity, AI is here to stay. Lucky for ...