Splunk Search

How can I fix tstats error after upgrading to Splunk 9.0.4?

keishsplunk
Explorer

Hi All,

we had successfully upgraded to Splunk 9.0.4.  However, we observed that when using tstats command, we are getting the below message. normal searches are all giving results as expected.

[indexer1,indexer2,indexer3,indexer4.indexer5] When used for 'tstats' searches, the 'WHERE' clause can contain only indexed fields. Ensure all fields in the 'WHERE' clause are indexed. Properly indexed fields should appear in fields.conf.

 

Any idea why we are getting this and how to resolve it.

keishsplunk_0-1682985422139.png

 

Labels (1)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @keishsplunk,

I don't know if something changed in the Splunk last version, but you should try to move the fields in the WHERE condition after the tstats command when they are also the BY fields, something like this:

| tstats count WHERE index=* BY sourcetype host
| search host=your_host

or

| tstats count WHERE index=* host=your_host BY sourcetype

Ciao.

Giuseppe

View solution in original post

0 Karma

mika703
Engager

We are experiencing the same issue after Upgrading from 8.2.9 to 9.0.5. Any Updates / Infos available?

0 Karma

keishsplunk
Explorer

Change the SPL syntax as such - 

| tstats count where index=* by sourcetype,host | search sourcetype=* host=heavy-forwarder-1

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @keishsplunk ,

good for you, see next time!

Ciao and happy splunking

Giuseppe

P.S.: Karma Points are appreciated 😉

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @keishsplunk,

I don't know if something changed in the Splunk last version, but you should try to move the fields in the WHERE condition after the tstats command when they are also the BY fields, something like this:

| tstats count WHERE index=* BY sourcetype host
| search host=your_host

or

| tstats count WHERE index=* host=your_host BY sourcetype

Ciao.

Giuseppe

0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...