Splunk Search

Why am I getting No results when when using "stats"?

Liran
Observer

I'm attempting to run a query and I've run into a really weird situation where if I run a query with "head 10 | fields *" I'm getting results but if I use "stats" with any field it does not return results.

For example, this query is returning the results:

 

 

index=main sourcetype=o365:management:activity Field1=Value1
| head 10
| fields * 

 

 

 

This is returning no results:

 

 

index=main sourcetype=o365:management:activity Field1=Value1
| stats count by _time

 

 

Somehow this does work and returns the result

 

index=main sourcetype=o365:management:activity Field1=Value1
| head 10
| stats count by _time

 

I've looked into it and did not manage to find similar issues, did anyone see anything similar before?

Labels (3)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Liran,

it's avery strange behavious that I never saw.

I suppose that you're using an user with admin grants.

Anyway, did you tried using a different field as index or sourcetype?

Did you tried to use the Verbose Mode?

Ciao.

Giuseppe

0 Karma

Liran
Observer

I forgot to mention I'm running queries trough an API so I don't have access to the Verbose Mode AFAIK.

I don't think there are any issues related to permissions and with other indices or sourcetypes it seems to work fine.

I've added a 3rd example to the original post with an addition query I've used that works.

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Liran,

I haven't a large experience in API using, so I hint to open a Case to Splunk Support.

ciao.

Giuseppe

0 Karma
Get Updates on the Splunk Community!

September Community Champions: A Shoutout to Our Contributors!

As we close the books on another fantastic month, we want to take a moment to celebrate the people who are the ...

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