All functions listed here are supported in:
The functions are listed without additional information. Click on the function to see the full details.
Function | Description |
---|---|
ascii | The ASCII code of the leftmost character of the value. |
bitlength | The length of value in bits. |
bytelength | The length of value in bytes. |
char | Return the character by interpreting the value as ASCII code. |
concat | The string resulting from concatenating the referenced item values or constant values. |
insert | Insert specified characters or spaces into the character string beginning at the specified position in the string. |
left | Return the leftmost characters of the value. |
length | The length of value in characters. |
ltrim | Remove specified characters from the beginning of string. |
mid | Return a substring of N characters beginning at the character position specified by 'start'. |
repeat | Repeat a string. |
replace | Find the pattern in the value and replace with replacement. |
right | Return the rightmost characters of the value. |
rtrim | Remove specified characters from the end of string. |
trim | Remove specified characters from the beginning and end of string. |
Some general notes on function parameters:
<
>
The ASCII code of the leftmost character of the value.
Supported value types: String, Text, Log.
Parameter:
For example, a value like 'Abc' will return '65' (ASCII code for 'A').
Example:
The length of value in bits.
Supported value types: String, Text, Log, Integer.
Parameter:
Example:
The length of value in bytes.
Supported value types: String, Text, Log, Integer.
Parameter:
Example:
Return the character by interpreting the value as ASCII code.
Supported value types: Integer.
Parameter:
The value must be in the 0-255 range. For example, a value like '65' (interpreted as ASCII code) will return 'A'.
Example:
The string resulting from concatenating the referenced item values or constant values.
Supported value types: String, Text, Log, Float, Integer.
Parameter:
For example, a value like 'Zab' concatenated to 'bix' (the constant string) will return 'Zabbix'.
Examples:
concat(last(/host/key),"bix")
concat("1 min: ",last(/host/system.cpu.load[all,avg1]),", 15 min: ",last(/host/system.cpu.load[all,avg15]))
Insert specified characters or spaces into the character string beginning at the specified position in the string.
Supported value types: String, Text, Log.
Parameter:
For example, a value like 'Zabbbix' will be replaced by 'Zabbix' if 'bb' (starting position 3, positions to replace 2) is replaced by 'b'.
Example:
Return the leftmost characters of the value.
Supported value types: String, Text, Log.
Parameter:
For example, you may return 'Zab' from 'Zabbix' by specifying 3 leftmost characters to return. See also right().
Example:
The length of value in characters.
Supported value types: String, Text, Log.
Parameter:
Examples:
length(last(/host/key)) #the length of the latest value
length(last(/host/key,#3)) #the length of the third most recent value
length(last(/host/key,#1:now-1d)) #the length of the most recent value one day ago
Remove specified characters from the beginning of string.
Supported value types: String, Text, Log.
Parameter:
Whitespace is left-trimmed by default (if no optional characters are specified). See also: rtrim(), trim().
Examples:
ltrim(last(/host/key)) #remove whitespace from the beginning of string
ltrim(last(/host/key),"Z") #remove any 'Z' from the beginning of string
ltrim(last(/host/key)," Z") #remove any space and 'Z' from the beginning of string
Return a substring of N characters beginning at the character position specified by 'start'.
Supported value types: String, Text, Log.
Parameter:
For example, it is possible return 'abbi' from a value like 'Zabbix' if starting position is 2, and positions to return is 4.
Example:
Repeat a string.
Supported value types: String, Text, Log.
Parameter:
Example:
Find the pattern in the value and replace with replacement. All occurrences of the pattern will be replaced.
Supported value types: String, Text, Log.
Parameter:
Example:
Return the rightmost characters of the value.
Supported value types: String, Text, Log.
Parameter:
For example, you may return 'bix' from 'Zabbix' by specifying 3 rightmost characters to return. See also left().
Example:
Remove specified characters from the end of string.
Supported value types: String, Text, Log.
Parameter:
Whitespace is right-trimmed by default (if no optional characters are specified). See also: ltrim(), trim().
Examples:
rtrim(last(/host/key)) #remove whitespace from the end of string
rtrim(last(/host/key),"x") #remove any 'x' from the end of string
rtrim(last(/host/key),"x ") #remove any 'x' and space from the end of string
Remove specified characters from the beginning and end of string.
Supported value types: String, Text, Log.
Parameter:
Whitespace is trimmed from both sides by default (if no optional characters are specified). See also: ltrim(), rtrim().
Examples: