Except where stated otherwise, all functions listed here are supported in:
Aggregate functions can work with either:
min(/host/key,1h)
min(last_foreach(/*/key))
(only in calculated items; cannot be used in triggers)The functions are listed without additional information. Click on the function to see the full details.
Function | Description |
---|---|
avg | The average value of an item within the defined evaluation period. |
bucket_percentile | Calculates the percentile from the buckets of a histogram. |
count | The count of values in an array returned by a foreach function. |
histogram_quantile | Calculates the φ-quantile from the buckets of a histogram. |
item_count | The count of existing items in configuration that match the filter criteria. |
kurtosis | The "tailedness" of the probability distribution in collected values within the defined evaluation period. |
mad | The median absolute deviation in collected values within the defined evaluation period. |
max | The highest value of an item within the defined evaluation period. |
min | The lowest value of an item within the defined evaluation period. |
skewness | The asymmetry of the probability distribution in collected values within the defined evaluation period. |
stddevpop | The population standard deviation in collected values within the defined evaluation period. |
stddevsamp | The sample standard deviation in collected values within the defined evaluation period. |
sum | The sum of collected values within the defined evaluation period. |
sumofsquares | The sum of squares in collected values within the defined evaluation period. |
varpop | The population variance of collected values within the defined evaluation period. |
varsamp | The sample variance of collected values within the defined evaluation period. |
/host/key
is a common mandatory first parameter for the functions referencing the host item history(sec|#num)<:time shift>
is a common second parameter for the functions referencing the host item history, where:
Some general notes on function parameters:
<
>
/host/key
and (sec|#num)<:time shift>
parameters must never be quotedThe average value of an item within the defined evaluation period.
Supported value types: Float, Integer.
Supported foreach functions: avg_foreach, count_foreach, exists_foreach, last_foreach, max_foreach, min_foreach, sum_foreach.
Parameters: see common parameters.
Time shift is useful when there is a need to compare the current average value with the average value some time ago.
Examples:
avg(/host/key,1h) #the average value for the last hour until now
avg(/host/key,1h:now-1d) #the average value for an hour from 25 hours ago to 24 hours ago from now
avg(/host/key,#5) #the average value of the five latest values
avg(/host/key,#5:now-1d) #the average value of the five latest values excluding the values received in the last 24 hours
Calculates the percentile from the buckets of a histogram.
Parameters:
Comments:
histogram_quantile(percentage/100, bucket_rate_foreach(item filter, time period, 1))
.The count of values in an array returned by a foreach function.
Supported value type: Integer.
Supported foreach functions: avg_foreach, count_foreach, exists_foreach, last_foreach, max_foreach, min_foreach, sum_foreach.
Parameters:
Using count() with a history-related foreach function (max_foreach, avg_foreach, etc.) may lead to performance implications, whereas using exists_foreach(), which works only with configuration data, will not have such effect.
Examples:
count(max_foreach(/*/net.if.in[*],1h)) #the number of net.if.in items that received data in the last hour until now
Calculates the φ-quantile from the buckets of a histogram.
Supported foreach function: bucket_rate_foreach.
Parameters:
Comments:
Examples:
histogram_quantile(0.75,1.0,last(/host/rate_bucket[1.0]),"+Inf",last(/host/rate_bucket[Inf]))
histogram_quantile(0.5,bucket_rate_foreach(//item_key,30s))
The count of existing items in configuration that match the filter criteria.
Supported value type: Integer.
Parameter:
Comments:
Examples:
item_count(/*/agent.ping?[group="Host group 1"]) #the number of hosts with the *agent.ping* item in the "Host group 1"
The "tailedness" of the probability distribution in collected values within the defined evaluation period. See also: Kurtosis.
Supported value types: Float, Integer.
Supported foreach function: last_foreach.
Parameters: see common parameters.
Example:
The median absolute deviation in collected values within the defined evaluation period. See also: Median absolute deviation.
Supported value types: Float, Integer.
Supported foreach function: last_foreach.
Parameters: see common parameters.
Example:
The highest value of an item within the defined evaluation period.
Supported value types: Float, Integer.
Supported foreach functions: avg_foreach, count_foreach, exists_foreach, last_foreach, max_foreach, min_foreach, sum_foreach.
Parameters: see common parameters.
Example:
max(/host/key,1h) - min(/host/key,1h) #calculate the difference between the maximum and minimum values within the last hour until now (the delta of values)
The lowest value of an item within the defined evaluation period.
Supported value types: Float, Integer.
Supported foreach functions: avg_foreach, count_foreach, exists_foreach, last_foreach, max_foreach, min_foreach, sum_foreach.
Parameters: see common parameters.
Example:
max(/host/key,1h) - min(/host/key,1h) #calculate the difference between the maximum and minimum values within the last hour until now (the delta of values)
The asymmetry of the probability distribution in collected values within the defined evaluation period. See also: Skewness.
Supported value types: Float, Integer.
Supported foreach function: last_foreach.
Parameters: see common parameters.
Example:
The population standard deviation in collected values within the defined evaluation period. See also: Standard deviation.
Supported value types: Float, Integer.
Supported foreach function: last_foreach.
Parameters: see common parameters.
Example:
The sample standard deviation in collected values within the defined evaluation period. See also: Standard deviation.
Supported value types: Float, Integer.
Supported foreach function: last_foreach.
Parameters: see common parameters.
At least two data values are required for this function to work.
Example:
The sum of collected values within the defined evaluation period.
Supported value types: Float, Integer.
Supported foreach functions: avg_foreach, count_foreach, exists_foreach, last_foreach, max_foreach, min_foreach, sum_foreach.
Parameters: see common parameters.
Example:
The sum of squares in collected values within the defined evaluation period.
Supported value types: Float, Integer.
Supported foreach function: last_foreach.
Parameters: see common parameters.
Example:
The population variance of collected values within the defined evaluation period. See also: Variance.
Supported value types: Float, Integer.
Supported foreach function: last_foreach.
Parameters: see common parameters.
Example:
The sample variance of collected values within the defined evaluation period. See also: Variance.
Supported value types: Float, Integer.
Supported foreach function: last_foreach.
Parameters: see common parameters.
At least two data values are required for this function to work.
Example: