Splunk Search

What is the purpose of TSTATS in a Summary Index?

mansel_scheffel
Explorer

Hi,

Quick question, is it possible, or is there any point to using tstats over stats when creating a summary index? Ultimately the reporting search will need to use a single value visual with a trendline based on changes over time..

Thanks

1 Solution

skoelpin
SplunkTrust
SplunkTrust

Yes there is a huge speed advantage of using tstats compared to stats.. You can only use tstats when the data has been re-indexed in your summary index since tstats can only look at indexed metadeta.. This will include sourcetype , host , source , and _time ..

So if your search looks like this

index=foo .. | tstats count by index source sourcetype then it will be much much faster than using stats

But if your field looks like this

index=foo .. | tstats count where myField>100 by account then tstats will not work because myField and account are not index-time fields

It is possible to use tstats with search time fields but theres a lot of extra steps

View solution in original post

somesoni2
Revered Legend

I would suggest to use tstats (if it's something suitable for your requirement, considering the fact tstats only works on indexed fields, not the search time extracted fields) over stats for summary index searches. The SI searches run frequently and it would be good for health of your Splunk system to run the most efficient searches.
In your report/dashboard which is using the summary index data, there will be no difference as the format of data stored in SI is same, but you'll save resources on background SI searches.

0 Karma

skoelpin
SplunkTrust
SplunkTrust

Yes there is a huge speed advantage of using tstats compared to stats.. You can only use tstats when the data has been re-indexed in your summary index since tstats can only look at indexed metadeta.. This will include sourcetype , host , source , and _time ..

So if your search looks like this

index=foo .. | tstats count by index source sourcetype then it will be much much faster than using stats

But if your field looks like this

index=foo .. | tstats count where myField>100 by account then tstats will not work because myField and account are not index-time fields

It is possible to use tstats with search time fields but theres a lot of extra steps

RR5027153
New Member

thanks . this is helpful information . can you please provide more detail on how tstats can be used with search time fields and will there any advantage over stats command when using search time fields in tstats

0 Karma
Get Updates on the Splunk Community!

Continuing Innovation & New Integrations Unlock Full Stack Observability For Your ...

You’ve probably heard the latest about AppDynamics joining the Splunk Observability portfolio, deepening our ...

Monitoring Amazon Elastic Kubernetes Service (EKS)

As we’ve seen, integrating Kubernetes environments with Splunk Observability Cloud is a quick and easy way to ...

Cloud Platform & Enterprise: Classic Dashboard Export Feature Deprecation

As of Splunk Cloud Platform 9.3.2408 and Splunk Enterprise 9.4, classic dashboard export features are now ...