Arithmetic Functions
Arithmetic functions operate on all valid numeric values (including string fields that are parseable into double numbers) from source fields and compute a single result to the target field. sum A sum of numeric values, as a double number. Example:- halfLife: the number of seconds for the half-life decay function.
- timestampField: the name of the field that contains the source event’s timestamp. By default, this is
timestamp_dt
. - defaultWeight: the weight of an event if all values from source fields are missing. The default is 0.1f, and this is expressed as a float.
String Functions
String functions operate all values from source fields treated as strings. cat A concatenation of string values. This function has some additional properties:- separator: the character to use as a delimiter between values. The default is a single space.
- maxStringLength: the maximum length of the concatenated values (including separators). When this limit is exceeded, additional values are discarded. The default value is 10485760 characters (10 * 1024 * 1024).
- maxValueCount: the maximum number of values to concatenate. Any values collected after this limit are discarded. The default is 100.
- separator: the character to use as a delimiter between values. The default is a single space.
- maxStringLength: the maximum length of the concatenated values (including separators). When this limit is exceeded, additional values are discarded. The default value is 10485760 characters (10 * 1024 * 1024).
- maxValueCount: the maximum number of values to concatenate. Any values collected after this limit are discarded. The default is 100.
- regex. (string, required) a regular expression used for splitting.
- lower. (boolean, optional, false by default) after the regex has been applied the resulting parts are optionally lower-cased (using US locale).
- regex. (string, required) a pattern to match.
- replace. (string, required) replacement.
Collection Functions
Collection functions simply collect values from the source fields and add them as multiple values to the target field. discard This function discards all values from source fields and the target field. This modifies the source event and any in-progress aggregation result. This creates side-effects for subsequent functions, so should be used with care. Example:Statistical Functions
Statistical functions compute scalar and matrix statistics. When the function has multiple results, such as for matrix or vector results, the data is stored in multiple fields. variance The square of standard deviation of numeric values, as a double number. Example:- quantiles: the number of quantiles. The default is 10.
- multiValued: when true, all quantiles will be stored as multiple values in the target field. If false, then multiple values will be created in the format ‘0.targetField’ to ‘N.targetField’.
- counts.targetField: integer counts (frequencies) of elements.
- values.targetField: elements.
- errors.targetField: estimation errors.
N * (N - 1)
fields following the naming pattern ‘sourceField1.sourceField2.targetField’.
If source fields contain multiple values, only the first value from each source field will be used.
This implementation runs in a constant and small memory budget.
Example:
N * (N - 1)
fields following the naming pattern ‘sourceField1.sourceField2.targetField’.
Example:
- weight. controls the range of values. Default weight is 1.0, which means that the sigmoid function values will range between (-1, 1). E.g. weight = 2.0 means that values will range between (-2, 2).
- intercept. sets the constant shift of function values. Default is 0, which means that sigmoid(0) = 0 and sigmoid(Inf) → 1. E.g. intercept = 2.0 means that sigmoid(0) = 2.0 and sigmoid(Inf) = 3.0.
- slope. this parameter controls the slope of the function, i.e. how quickly it reaches saturation. Default value is 1.0. E.g. slope = 2 will cause the function to saturate quickly, slope = 0.1 will cause the function to saturate for larger values of source.
- final. boolean, default is true. This controls how the sigmoid is applied to the source value. First, all numeric values from source fields are summed. Then, if final = false the current sum is passed to the sigmoid function and added to the previous total. If final = true then the current sum is added to the total and the sigmoid function is applied only at the end of the aggregation.
Logical Functions
when A logical function where processing will continue only if this function evaluates to true. This function takes one additional property, ‘expr’, which is a JavaScript expression that must evaluate to a Boolean true/false. This property takes the same objects as the ‘expr’ function, described above. If this property is missing, the function will evaluate to true when any sourceField or targetField is present. Example:Scripting Functions
script A scripted function. Scripts are evaluated as snippets, not as a function, and are expected to operate directly on the source event and the result. Their final values are discarded, since snippets in JavaScript are treated as expressions that evaluate to a specific value. This function ignores the sourceFields and targetFields properties. Instead, the snippets are passed the following properties:- startScript: the script defined is executed when the aggregation for the next unique tuple starts.
- aggregateScript: the script defined is executed for each source event.
- finishScript: the script is defined when all events for the current tuple have been processed and the result is about to be returned.