Splunk® Data Stream Processor

Function Reference

Acrobat logo Download manual as PDF


On April 3, 2023, Splunk Data Stream Processor will reach its end of sale, and will reach its end of life on February 28, 2025. If you are an existing DSP customer, please reach out to your account team for more information.
This documentation does not apply to the most recent version of Splunk® Data Stream Processor. For documentation on the most recent version, go to the latest release.
Acrobat logo Download topic as PDF

Aggregation

The following are scalar functions that you can use in the aggregation streaming function to perform calculations over data in a given time-window.

average(X)

Calculates the average (mean) of values in a time window.

Function Input
number
Function Output
double

DSL example

The following example returns the average value of the "time_taken" field.

aggregate(windowed, average(get("time_taken")));

count(X)

Returns the number of non-null values in a time window.

Function Input
any
Function Output
long

DSL example

Returns the count of the "status_code" field.

aggregate(windowed, count(get("status_code")));

max(X)

Returns the maximum value in a time window.

Function Input
number
Function Output
number

DSL example

Returns the maximum value of the "time_taken" field.

aggregate(windowed, max(get("time_taken")));

mean(X)

Calculates the average (mean) of values in a time window.

Function Input
number
Function Output
double

DSL example

Returns the average value of the "time_taken" field.

aggregate(windowed, mean(get("time_taken")));

min(X)

Returns the minimum value in a time window.

Function Input
number
Function Output
number

DSL example

Returns the minimum value of the "time_taken" field.

aggregate(windowed, min(get("time_taken")));

sum(X)

Returns the sum of values in a time window.

Function Input
number
Function Output
number

DSL example

Returns the sum of the "time_taken" field.

aggregate(windowed, sum(get("time_taken")));
Last modified on 02 January, 2020
PREVIOUS
Core scalar functions
  NEXT
Arithmetic

This documentation applies to the following versions of Splunk® Data Stream Processor: 1.0.1


Was this documentation topic helpful?


You must be logged into splunk.com in order to post comments. Log in now.

Please try to keep this discussion focused on the content covered in this documentation topic. If you have a more general question about Splunk functionality or are experiencing a difficulty with Splunk, consider posting a question to Splunkbase Answers.

0 out of 1000 Characters