Statistical and charting functions
Statistical and charting functions
- Functions that are relevant for stats are also relevant for
- Functions that are relevant for chart, stats, and timechart are also relevant for their respective summary indexing counterparts:
- Functions that are relevant for sparklines will say as much. Note that sparklines is not a search command, it is a function that applies only to
statsand allows you to call other functions. For more information, read "Add sparklines to search results" in the Search Manual.
|Returns the average of the values of field X. See also, mean(X).||This examples returns the average response time:
|Returns the number of occurrences of the field X. To indicate a specific field value to match, format X as eval(field="value").||This example returns the count of events where |
These generate sparklines for the counts of events. The first looks at the
|Returns the count of distinct values of the field X.|| This example generates sparklines for the distinct count of devices and renames the field, "numdevices":
This example counts the distinct sources for each sourcetype, and buckets the count for each five minute spans:
| ||Returns the chronologically earliest seen occurrence of a value of a field X.|
| ||Returns the estimated count of the distinct values of the field X.|| |
| ||Returns the theoretical error of the estimated count of the distinct values of the field X. The error represents a ratio of abs(estimate_value - real_value)/real_value.|| |
| ||Returns the first seen value of the field X. In general, the first seen value of the field is the most recent instance of this field, relative to the input order of events into the stats command.|
|Returns the last seen value of the field X. In general, the last seen value of the field is the oldest instance of this field relative to the input order of events into the stats command.|
| ||Returns the chronologically latest seen occurrence of a value of a field X.|
|Returns the list of all values of the field X as a multivalue entry. The order of the values reflects the order of input events.|
|Returns the maximum value of the field X. If the values of X are non-numeric, the max is found from lexicographic ordering.||This example returns the maximum value of "size":
|Returns the arithmetic mean of the field X. See also, avg(X).||This example returns the mean of "kbps" values:
| Returns the middle-most value of the field X.
Note: The median calculation is more correct for odd numbers of events. In cases where you have an even number of events, the median is approximated to be the higher of the two values.
|Returns the minimum value of the field X. If the values of X are non-numeric, the min is found from lexicographic ordering.|
|Returns the most frequent value of the field X.|
| Returns the X-th percentile value of the numeric field Y, where X is an integer between 1 and 99. The percentile X-th function sorts the values of Y in an increasing order. Then, if you consider that 0% is the lowest and 100% the highest, the functions picks the value that corresponds to the position of the X% value.
The functions perc, p, and upperperc give approximate values for the integer percentile requested. The approximation algorithm used provides a strict bound of the actual value for any percentile. The functions perc and p return a single number that represents the lower end of that range while upperperc gives the approximate upper bound. exactperc provides the exact value, but will be very expensive for high cardinality fields.
| For the list of values |
|Returns the values of field X per day.||This example returns the values of "total" per day.
|Returns the values of field X per hour.||This example returns the values of "total" per hour.
|Returns the values of field X per minute.||This example returns the values of "total" per minute.
|Returns the values of field X per second.||This example returns values of "kb" per second:
|Returns the difference between the max and min values of the field X ONLY IF the value of X are numeric.|
|Returns the sample standard deviation of the field X.||This example returns the standard deviation of wildcarded fields "*delay" which can apply to both, "delay" and "xdelay".
|Returns the population standard deviation of the field X.|
|Returns the sum of the values of the field X.|
|Returns the sum of the squares of the values of the field X.|
|Returns the list of all distinct values of the field X as a multivalue entry. The order of the values is lexicographical.|
|Returns the sample variance of the field X.|
|Returns the population variance of the field X.|
This documentation applies to the following versions of Splunk: 6.0 , 6.0.1 , 6.0.2 , 6.0.3 , 6.0.4 , 6.0.5 , 6.0.6 , 6.0.7 , 6.0.8 , 6.0.9 , 6.1 , 6.1.1 , 6.1.2 , 6.1.3 , 6.1.4 , 6.1.5 , 6.1.6 , 6.1.7 , 6.1.8 , 6.2.0 , 6.2.1 , 6.2.2 , 6.2.3 , 6.2.4