Splunk Search

Merge Related Data From Two Different Sourcetypes Into One Row of A Table

xamiel
Explorer

Here's the query I have that is getting results from two sourcetypes:

index=bro (sourcetype=bro_files OR sourcetype=bro_http) FBAT7S1VCAkUPRDte2 | eval fuid=coalesce(resp_fuids, orig_fuids, fuid) | table fuid, seen_bytes, md5, mime_type, domain, uri

Here's the results:

fuid seen_bytes md5 mime_type domain uri
FBAT7S1VCAkUPRDte2 215978730 f3906f58da42a24b853d26c83e4488e5 application/zip
FBAT7S1VCAkUPRDte2 application/zip ex.com /test.zip

Desired results:

fuid seen_bytes md5 mime_type domain uri
FBAT7S1VCAkUPRDte2 215978730 f3906f58da42a24b853d26c83e4488e5 application/zip ex.com /test.zip

Tags (1)
0 Karma
1 Solution

lguinn2
Legend

I've added a stats command to combine the rows...

index=bro (sourcetype=bro_files OR sourcetype=bro_http) FBAT7S1VCAkUPRDte2 
| eval fuid=coalesce(resp_fuids, orig_fuids, fuid) 
| stats first(seen_bytes) as seen_bytes, first(md5) as md5, first(mime_type) as mime_type, 
     first(domain) as domain, first(uri) as uri by fuid
| table fuid, seen_bytes, md5, mime_type, domain, uri

View solution in original post

0 Karma

lguinn2
Legend

I've added a stats command to combine the rows...

index=bro (sourcetype=bro_files OR sourcetype=bro_http) FBAT7S1VCAkUPRDte2 
| eval fuid=coalesce(resp_fuids, orig_fuids, fuid) 
| stats first(seen_bytes) as seen_bytes, first(md5) as md5, first(mime_type) as mime_type, 
     first(domain) as domain, first(uri) as uri by fuid
| table fuid, seen_bytes, md5, mime_type, domain, uri
0 Karma

xamiel
Explorer

Ahh stats first()! Works perfectly. Thanks. 🙂

0 Karma
Get Updates on the Splunk Community!

Preparing your Splunk Environment for OpenSSL3

The Splunk platform will transition to OpenSSL version 3 in a future release. Actions are required to prepare ...

Unleash Unified Security and Observability with Splunk Cloud Platform

     Now Available on Microsoft AzureThursday, March 27, 2025  |  11AM PST / 2PM EST | Register NowStep boldly ...

Splunk AppDynamics with Cisco Secure Application

Web applications unfortunately present a target rich environment for security vulnerabilities and attacks. ...