Splunk Search

How i merge multiple events based on the same value in a field?

leonl_0
Observer

I currently have events that include load times and events that include header colour for my app. These events both have the user's session id. How do I join the two events based on session Id so i can see the load time based on header colour?

Query for Load time:

 

index="main" measurement_type=loadTime screen_class_name=HomeFragment

 

 Query for HeaderColour:

 

index=api_analytics sourcetype=api_analytics 
| `expand_api_analytics`
| search iri=home/header
| spath input=analytic path=session_id output=session_id

 

Labels (2)
0 Karma

leonl_0
Observer

If i use the following command, it truncates everything in the second query so that I only have one unique value for every other fields

index=main measurement_type=loadTime screen_class_name=HomeFragment
| join sessionId [search index=api_analytics sourcetype=api_analytics
| `expand_api_analytics`
| search iri=home/header
| spath input=analytic path=session_id output=sessionId]

 

0 Karma
Get Updates on the Splunk Community!

Observability Unlocked: Kubernetes Monitoring with Splunk Observability Cloud

  Ready to master Kubernetes and cloud monitoring like the pros?Join Splunk’s Growth Engineering team for an ...

Wrapping Up Cybersecurity Awareness Month

October might be wrapping up, but for Splunk Education, cybersecurity awareness never goes out of season. ...

🌟 From Audit Chaos to Clarity: Welcoming Audit Trail v2

🗣 You Spoke, We Listened  Audit Trail v2 wasn’t written in isolation—it was shaped by your voices.  In ...