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!

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...