Mathematical
abs
Mathematical evaluation function that returns a number's absolute value. Use this scalar function with the eval or the filter streaming functions. Numbers can be type int, long, float, or double.
- Function Input
- number
- Function Output
- number
DSL example
Returns 1.2.
abs(-1.2);
ceiling
Mathematical evaluation function that rounds a number up to the next highest integer. Returns the result as a double. Use this scalar function with the eval or the filter streaming functions. Numbers can be type int, long, float, or double.
- Function Input
- number
- Function Output
- double
DSL example
Returns 2 as a double.
ceiling(1.2);
exponential
Mathematical evaluation function that takes a number X and returns the exponential eˣ as a double. Use this scalar function with the eval or the filter streaming functions. Numbers can be type int, long, float, or double.
- Function Input
- number
- Function Output
- double
DSL example
Returns 2.718281828459045 as a double.
exp(1);
floor
Mathematical evaluation function that rounds a number down to the nearest integer. Returns the result as a double. Use this scalar function with the eval or the filter streaming functions. Numbers can be type int, long, float, or double.
- Function Input
- number
- Function Output
- double
DSL example
Returns 1 as a double.
floor(1.2);
logarithm
This function takes either one or two numeric arguments and returns the logarithm of the first argument X using the second argument Y as the base. If the second argument Y is omitted, this function evaluates the logarithm of number X with base 10. Use this scalar function with the eval or the filter streaming functions. Numbers can be type int, long, float, or double.
- Function Input
- input: number
- base: number
- Function Output
- double
DSL example
Returns 4 as a double.
log(16,2);
natural logarithm
Mathematical evaluation function that takes a number and returns its natural logarithm as a double. Returns null for invalid values. Use this scalar function with the eval or the filter streaming functions. Numbers can be type int, long, float, or double.
- Function Input
- number
- Function Output
- double
DSL example
Returns 0 as a double.
ln(1);
pi
Mathematical evaluation function that takes no arguments, but returns the constant pi to 20 digits of precision. Use this scalar function with the eval or the filter streaming functions.
- Function Input
- null
- Function Output
- double
DSL example
Returns 3.14159265358979323846 as a double.
pi();
power of base
Mathematical evaluation function that takes two numeric arguments, X and Y, and returns XY as a double. Use this scalar function with the eval or the filter streaming functions. Numbers can be type int, long, float, or double.
- Function Input
- base: number
- exp: number
- Function Output
- double
DSL example
Returns 4 as a double.
pow(2,2);
round value
Mathematical evaluation function that takes two numeric arguments, X and Y, and returns X rounded to the amount of decimal places specified by Y. Use this scalar function with the eval or the filter streaming functions.
- Function Input
- num_dec: integer
- value: double
- Function Output
- double
DSL example
Returns 2.56 as a double.
round(cast(2.555d, "double"), 2);
round value
Mathematical evaluation function that takes a numeric argument X and returns X rounded to the nearest whole number. Use this scalar function with the eval or the filter streaming functions.
- Function Input
- double
- Function Output
- double
DSL example
Returns 3.0 as a double.
round(cast(2.555d, "double"));
square root
Mathematical evaluation function that takes a number X and returns its square root. Use this scalar function with the eval or the filter streaming functions. Numbers can be type int, long, float, or double.
- Function Input
- number
- Function Output
- double
DSL example
Returns 10 as a double.
sqrt(100);
Date and Time | Multivalue |
This documentation applies to the following versions of Splunk® Data Stream Processor: 1.0.0
Feedback submitted, thanks!