Splunk Search

Why does the "tstats count" and "tstats values" generate a different event count?

eugenezxq
New Member

I have 2 queries:
|tstats values(sth.sth) as sth... |stats count by sth | ...

and

|tstats count from datamodel=sth ... | stats count by sth |...

both give me a different event count. Just want to know why that is the case.

0 Karma

inventsekar
SplunkTrust
SplunkTrust

count(X)

This function returns the number of occurrences of the field X.

values(X)
This function returns the list of all distinct values of the field X as a multi-value entry. The order of the values is lexicographical.

this is from stats command page.. this will be applicable for tstats as well, i think
http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonStatsFunctions

As you are a new user to Splunk Answers, you can upvote the answers/comments,
if this answer resolved your query, you can select this answer and "accept" it as the answer, so that this question will be moved to answered queue. Happy Splunking!

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...