FIXME This page is not fully translated, yet. Please help completing the translation.
(remove this paragraph once the translation is finished)
All functions listed here are supported in:
Some general notes on function parameters:
<
>
FUNCTION | |||
---|---|---|---|
Description | Function-specific parameters | Comments | |
ascii | |||
The ASCII code of the leftmost character of the value. | Supported value types: string, text, log For example, a value like 'Abc' will return '65' (ASCII code for 'A'). Example: => ascii(last(/host/key)) |
||
bitlength | |||
The length of value in bits. | Supported value types: string, text, log, integer Example: => bitlength(last(/host/key)) |
||
bytelength | |||
The length of value in bytes. | Supported value types: string, text, log, integer Example: => bytelength(last(/host/key)) |
||
char | |||
Return the character by interpreting the value as ASCII code. | Supported value types: integer The value must be in the 0-255 range. For example, a value like '65' (interpreted as ASCII code) will return 'A'. Example: => char(last(/host/key)) |
||
concat (string) | |||
The string resulting from concatenating the value to the specified string. | string - the string to concatenate to | Supported value types: string, text, log For example, a value like 'Zab' concatenated to 'bix' (the specified string) will return 'Zabbix'. Example: => concat(last(/host/key),"bix") |
|
insert (start,length,replacement) | |||
Insert specified characters or spaces into the character string beginning at the specified position in the string. | start - start position length - positions to replace replacement - replacement string |
Supported value types: string, text, log 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: => insert(last(/host/key),3,2,"b") |
|
left (count) | |||
The leftmost characters of the value. | count - number of characters to return | Supported value types: string, text, log For example, you may return 'Zab' from 'Zabbix' by specifying 3 leftmost characters to return. Example: => left(last(/host/key),3) - return three leftmost characters See also right(). |
|
length | |||
The length of value in characters. | Supported value types: str, text, log Example: => length(last(/host/key)) → length of the latest value => length(last(/host/key,#3)) → length of the third most recent value => length(last(/host/key,#1:now-1d)) → length of the most recent value one day ago |
||
ltrim (<chars>) | |||
Remove specified characters from the beginning of string. | chars - (optional) specify characters to remove Whitespace is left-trimmed by default (if no optional characters are specified). |
Supported value types: string, text, log Example: => 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 See also: rtrim(), trim() |
|
mid (start,length) | |||
Return a substring of N characters beginning at the character position specified by 'start'. | start - start position of substring length - positions to return in substring |
Supported value types: string, text, log For example, it is possible return 'abbi' from a value like 'Zabbix' if starting position is 2, and positions to return is 4). Example: => mid(last(/host/key),2,4)="abbi" |
|
repeat (count) | |||
Repeat a string. | count - number of times to repeat | Supported value types: string, text, log Example: => repeat(last(/host/key),2) - repeat the value two times |
|
replace (pattern,replacement) | |||
Find pattern in the value and replace with replacement. All occurrences of the pattern will be replaced. | pattern - pattern to find replacement - string to replace the pattern with |
Supported value types: string, text, log Example: => replace(last(/host/key),"ibb","abb") - replace all 'ibb' with 'abb' |
|
right (count) | |||
The rightmost characters of the value. | count - number of characters to return | Supported value types: string, text, log For example, you may return 'bix' from 'Zabbix' by specifying 3 rightmost characters to return. Example: => right(last(/host/key),3) - return three rightmost characters See also left(). |
|
rtrim (<chars>) | |||
Remove specified characters from the end of string. | chars - (optional) specify characters to remove Whitespace is right-trimmed by default (if no optional characters are specified). |
Supported value types: string, text, log Example: => 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' or space from the end of string See also: ltrim(), trim() |
|
trim (<chars>) | |||
Remove specified characters from the beginning and end of string. | chars - (optional) specify characters to remove Whitespace is trimmed from both sides by default (if no optional characters are specified). |
Supported value types: string, text, log Example: => trim(last(/host/key)) - remove whitespace from the beginning and end of string => trim(last(/host/key),"_") - remove '_' from the beginning and end of string See also: ltrim(), rtrim() |
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: