11. Regular expressions
Overview
Complex regular expressions can be created and tested in the Zabbix frontend.
After a regular expression has been created, it can be used in several places in the frontend by referring to its name, prefixed with @, for example, @mycustomregexp.
All regular expressions in Zabbix, whether created with the advanced editor, or entered manually, support POSIX extended regular expressions.
Configuration
To create a regular expression:
-
Go to: Administration → General
-
Select Regular expressions from the dropdown
-
Click on New regular expression
The Expressions tab allows to set the regular expression name and add subexpressions.
Parameter | Description |
---|---|
Name | Set the regular expression name. Any Unicode characters are allowed. |
Expressions | Click on Add in the Expressions block to add a new subexpression. |
Regular expression names must not be quoted in other locations (for example, in LLD rule properties).
A custom regular expression may consist of multiple subexpressions, and it can be tested in the Test tab by providing a test string.
Results show the status of each subexpression and total custom expression status.
Data source: Zabbix