This is a translation of the original English documentation page. Help us make it better.

correlation.create

Leírás

object correlation.create(object/array correlations)

Ez a módszer lehetővé teszi új összefüggések létrehozását.

Ez a módszer csak a Super admin felhasználótípus számára érhető el. A metódus meghívására vonatkozó engedélyeket a felhasználói szerepkör beállításaiban lehet visszavonni. Lát User roles további információért.

Parameters

(object/array) Correlations to create.

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

Parameter Type Description
operations
(required)
array Correlation operations to create for the correlation.
filter
(required)
object Correlation filter object for the correlation.

Visszatérési értékek

(object) A létrehozott objektum azonosítóit tartalmazó objektumot ad vissza korrelációk a correlationids tulajdonság alatt. A sorrend a A visszaadott azonosítók megegyeznek az átadott korrelációk sorrendjével.

Példák

Create a new event tag correlation

Create a correlation using evaluation method AND/OR with one condition and one operation. By default the correlation will be enabled.

Request:

{
           "jsonrpc": "2.0",
           "method": "correlation.create",
           "params": {
               "name": "new event tag correlation",
               "filter": {
                   "evaltype": 0,
                   "conditions": [
                       {
                           "type": 1,
                           "tag": "ok"
                       }
                   ]
               },
               "operations": [
                   {
                       "type": 0
                   }
               ]
           },
           "auth": "343baad4f88b4106b9b5961e77437688",
           "id": 1
       }
Copy
✔ Copied

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "correlationids": [
                   "1"
               ]
           },
           "id": 1
       }
Copy
✔ Copied

Using a custom expression filter

Create a correlation that will use a custom filter condition. The formula IDs "A" or "B" have been chosen arbitrarily. Condition type will be "Host group" with operator "<>".

Request:

{
           "jsonrpc": "2.0",
           "method": "correlation.create",
           "params": {
               "name": "new host group correlation",
               "description": "a custom description",
               "status": 0,
               "filter": {
                   "evaltype": 3,
                   "formula": "A or B",
                   "conditions": [
                       {
                           "type": 2,
                           "operator": 1,
                           "formulaid": "A"
                       },
                       {
                           "type": 2,
                           "operator": 1,
                           "formulaid": "B"
                       }
                   ]
               },
               "operations": [
                   {
                       "type": 1
                   }
               ]
           },
           "auth": "343baad4f88b4106b9b5961e77437688",
           "id": 1
       }
Copy
✔ Copied

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "correlationids": [
                   "2"
               ]
           },
           "id": 1
       }
Copy
✔ Copied

Lásd még

Forrás

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

To toggle search highlight, press Ctrl+Alt+H
Have an improvement suggestion for this page? Select the text that could be improved and press Ctrl+Enter to send it to the editors.