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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...