Show Menu
TOPICS×

Math

The Math transformation enables the use of arithmetic operations on fields within the log entries.
The operations can include decimal integers and floating point constants.
Field Description Default
Name Descriptive name of the transformation. You can enter any name here.
Comments Optional. Notes about the transformation.
Condition The conditions under which this transformation is applied.
Expression
An arithmetic expression that describes the computation to be performed.
You can use any of the operations and functions listed below, and you can incorporate field names in the expression:
Operations
  • Addition (+)
  • Subtraction (-)
  • Multiplication (*)
  • Division (/)
  • Remainder (%)
  • Exponentiation (^)
Functions
  • sgn(x). Returns 1 if x is positive, 0 if x is zero, or -1 if x is negative.
  • abs(x). Returns the absolute value of x.
  • floor(x). Returns the greatest integer less than or equal to x.
  • round(x). Returns the nearest integer to x.
  • log(b,x). Returns the logarithm of x base b.
  • min(x,y,...). Returns the smallest of all its arguments.
  • max(x,y,...). Returns the largest of all its arguments.
Output The name of the field containing the result of the arithmetic operation.
In this example, which uses fields of data collected from website traffic, a new field named x-page-duration is calculated by subtracting x-last-pv-timestamp from x-timestamp, then adding 1. The output is calculated only if the user-defined field x-last-pv-timestamp (which represents the timestamp of a visitor's last page view), is populated, or "not empty."
For information about the Not Empty condition, see Conditions .