Splunk® Data Stream Processor

DSP 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

Arithmetic

Perform computations on a set of given values.

add(X,Y)

Arithmetic function that adds the left and right arguments and returns the result. The input is implicitly converted to the highest type in the number hierarchy: Integer < Long < Float < Double.

Function Input
Left: number
Right: number
Function Output
number

DSL example

Returns 2.

add(1, 1);

div(X,Y)

Arithmetic function that divides the left and right arguments and returns the result. It will return null for division by zero. Input is implicitly converted to the highest type in the number hierarchy: Integer < Long < Float < Double.

Function Input
Left: number
Right: number
Function Output
number

DSL example

Returns 2.

div(3, 1.5F);

mul(X,Y)

Arithmetic function which multiplies the left and right arguments and returns the result. Input is implicitly converted to the highest type in the Number hierarchy: Integer < Long < Float < Double.

Function Input
Left: number
Right: number
Function Output
number

DSL example

Returns 10.

mul(4L, 2.5D);

mod(X,Y)

Arithmetic function that finds the remainder after dividing the left and right arguments. It will return null for modulo by zero. Input is implicitly converted to the highest type in the number hierarchy: Integer < Long < Float < Double.

Function Input
Left: number
Right: number
Function Output
number

DSL example

Returns 2.

mod(5L, 3);

subtract(X,Y)

Arithmetic function that subtracts the left and right arguments and returns the result. Input is implicitly converted to the highest type in the number hierarchy: Integer < Long < Float < Double.

Function Input
Left: number
Right: number
Function Output
number

DSL example

Returns 11 as a float.

subtract(15F, 4L);
Last modified on 31 October, 2019
PREVIOUS
Aggregation
  NEXT
Boolean

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


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