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!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...