This is the documentation page for an unsupported version of Zabbix.
Is this not what you were looking for? Switch to the current version or choose one from the drop-down menu.

regexp.create

Description

object regexp.create(object/array regularExpressions)

This method allows to create new global regular expressions.

This method is only available to Super admin user types. Permissions to call the method can be revoked in user role settings. See User roles for more information.

Parameters

(object/array) Regular expressions to create.

Additionally to the standard properties, the method accepts the following parameters.

Parameter Type Description
expressions array Expressions options.

Valori di ritorno

(oggetto) Restituisce un oggetto contenente gli ID delle espressioni regolari create sotto la proprietà regexpids.

Esempi

Creating a new global regular expression.

Request:

{
           "jsonrpc": "2.0",
           "method": "regexp.create",
           "params": {
             "name": "Storage devices for SNMP discovery",
             "test_string": "/boot",
             "expressions": [
               {
                 "expression": "^(Physical memory|Virtual memory|Memory buffers|Cached memory|Swap space)$",
                 "expression_type": "4",
                 "case_sensitive": "1"
               }
             ]
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "regexpids": [
                   "16"
               ]
           },
           "id": 1
       }

Fonte

CRegexp::create() in ui/include/classes/api/services/CRegexp.php.