Splunk Search

Search Multiple Sourcetypes using different fields - return all rawevent information for all sourcetypes

jeurich
New Member

I need help figuring out the best way to get the information I want in one query.

I have indexA with sourcetypeA, sourcetypeB and sourcetypeC. I also have indexB with sourcetypeD.

I input two values to search for within sourcetypeA. The results will give me three fields that I need to use to search the remaining sourcetypes. I want the results return the raw events for all instances that are found.

basically - sourcetypeA contains field1, field2, field3
sourcetypeB and sourcetypeC contain field1, field2, field3. But I need the output from sourcetypeA (field1, field2, field3) in order to search sourcetypeB and sourcetypeC for matching fields.
sourcetypeD contains field2 and field3 - I need the output from sourcetypeA or sourcetypeB to search for field2 and field3 in sourcetypeD

Here is what i have tried and only gotten part of what i want. (there have been numerous attempts to figure this out).

sourcetype=logA input1=NAME input2=ADDRESS | join type=outer field2 [search sourcetypeD]

0 Karma

tiagofbmm
Influencer

Use the return function.

sourcetypeB
[ search index=indexA sourcetype=sourcetypeA
| dedup fieldA, fieldB, fieldC
| return fieldA, fieldB, fieldC]
| append [sourcetypeC
[ search index=indexA sourcetype=sourcetypeA
| dedup fieldA, fieldB, fieldC
| return fieldA, fieldB, fieldC]]

0 Karma

tiagofbmm
Influencer

Please let me know if the answer was useful for you. If it was, accept it and upvote. If not, give us more input so we can help you with that

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

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 ...