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)

 

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

sainag_splunk
Splunk Employee
Splunk Employee

Do you mean like this ?

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

 

Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...