Splunk Search

Howcome additional condition increases result count?

shai
Explorer

my question is very simple. 

This returns nothing:

 

sourcetype=my_sourcetype

 

This returns X amount of events (same amount as index=my_index):

 

index=my_index AND sourcetype=my_sourcetype

 

Search is in: Verbose Mode
what am I missing?! 
howcome another filter returns more events?

0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @shai ,

in the [Settings > Roles > Indexes] Tab, are your index flagged also in the Default column?

gcusello_0-1697118743593.png

Ciao.

Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi @shai,

this means that your index isn't in the search default path for your role [Settings > Roles > your_role > Indexes].

Anyway, it's always a best practice to use the index filter in every search, trying to limit the indexes to only the ones where the log to search are stored: this approach redduces the time search.

Ciao.

Giuseppe

0 Karma

shai
Explorer

Hi @gcusello 
Thank you for your response

However it does not explain the odd behaviour because I use admin Role and in the setting page that you have referred me to, all the indices are included. So can you explain what else I might be missing?

Note that I witnessed this issue not only with indexes but with sourcetype.
for example searching for field=value yielded zero results but searching field=value AND sourcetype=certail_type did return results... 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @shai,

which Mode are you using in your searches?

did you try to use Verbose Mode?

Ciao.

Giuseppe

0 Karma

shai
Explorer

hi @gcusello 
as written in the original post the mode is Verbose.

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @shai ,

in the [Settings > Roles > Indexes] Tab, are your index flagged also in the Default column?

gcusello_0-1697118743593.png

Ciao.

Giuseppe

shai
Explorer

@gcusello 
marking as default solved the issue. thank you very much.

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @shai,

good for you, see next time!

let me know if I can help you more, or, please, accept one answer for the other people of Community.

Ciao and happy splunking

Giuseppe

P.S.: Karma Points are appreciated 😉

Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...

Customer success is front and center at .conf25

Hi Splunkers, If you are not able to be at .conf25 in person, you can still learn about all the latest news ...

.conf25 Global Broadcast: Don’t Miss a Moment

Hello Splunkers, .conf25 is only a click away.  Not able to make it to .conf25 in person? No worries, you can ...