Splunk Search

How to search based on multiple indexes and their respective sourceTypes

nainil0683
Engager

Hi,

   I have index called Index1 which has sourcetype called SourceType1 and another index called Index2 with sourceType called SourceType2.

Some data is in combination of Index1<-> SourceType1 and some data is in combination of Index2<->SourceType2.

 

How can I write a query that targets the correct index and sourceType?

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Labels (1)
0 Karma
1 Solution

sainag_splunk
Splunk Employee
Splunk Employee

Do you mean like this ?

(index=Index1 sourcetype=SourceType1) OR (index=Index2 sourcetype=SourceType2)

 

If this helps, Upvote!!!!
Together we make the Splunk Community stronger 

View solution in original post

nainil0683
Engager

Yes, exactly like this.

I was beating around the bushes, but this one works perfectly.

Thanks a lot @sainag_splunk  👍

0 Karma

sainag_splunk
Splunk Employee
Splunk Employee

Glad it was helpful. 

If this reply helps you an upvote and "Accept as Solution" is appreciated.
 
If this helps, Upvote!!!!
Together we make the Splunk Community stronger 
0 Karma

sainag_splunk
Splunk Employee
Splunk Employee

Do you mean like this ?

(index=Index1 sourcetype=SourceType1) OR (index=Index2 sourcetype=SourceType2)

 

If this helps, Upvote!!!!
Together we make the Splunk Community stronger 
Get Updates on the Splunk Community!

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...

Cloud Monitoring Console - Unlocking Greater Visibility in SVC Usage Reporting

For Splunk Cloud customers, understanding and optimizing Splunk Virtual Compute (SVC) usage and resource ...

Automatic Discovery Part 3: Practical Use Cases

If you’ve enabled Automatic Discovery in your install of the Splunk Distribution of the OpenTelemetry ...