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!

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...

Cloud Monitoring Console - Unlocking Greater Visibility in SVC Usage Reporting

For Splunk Cloud customers, understanding and optimizing Splunk Virtual Compute (SVC) usage and resource ...

Automatic Discovery Part 3: Practical Use Cases

If you’ve enabled Automatic Discovery in your install of the Splunk Distribution of the OpenTelemetry ...