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!

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...