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!

CX Day is Coming!

Customer Experience (CX) Day is on October 7th!! We're so excited to bring back another day full of wonderful ...

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...