correlation.get

Description

integer/array correlation.get(object **parameters**)

The method allows to retrieve correlations according to the given parameters.

This method is available to users of any type. Permissions to call the method can be revoked in user role settings. See User roles for more information.

Parameters

(object) Parameters defining the desired output.

The method supports the following parameters.

ParameterTypeDescription
correlationidsstring/arrayReturn only correlations with the given IDs.
selectFilterqueryReturn a filter property with the correlation conditions.
selectOperationsqueryReturn an operations property with the correlation operations.
sortfieldstring/arraySort the result by the given properties.

Possible values are: correlationid, name and status.
countOutputbooleanThese parameters being common for all get methods are described in the reference commentary.
editableboolean
excludeSearchboolean
filterobject
limitinteger
outputquery
preservekeysboolean
searchobject
searchByAnyboolean
searchWildcardsEnabledboolean
sortorderstring/array
startSearchboolean

Return values

(integer/array) Returns either:

  • an array of objects;

  • the count of retrieved objects, if the countOutput parameter has been used.

Examples

Retrieve correlations

Retrieve all configured correlations together with correlation conditions and operations. The filter uses the “and/or” evaluation type, so the formula property is empty and eval_formula is generated automatically.

Request:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "correlation.get",
  4. "params": {
  5. "output": "extend",
  6. "selectOperations": "extend",
  7. "selectFilter": "extend"
  8. },
  9. "auth": "343baad4f88b4106b9b5961e77437688",
  10. "id": 1
  11. }

Response:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": [
  4. {
  5. "correlationid": "1",
  6. "name": "Correlation 1",
  7. "description": "",
  8. "status": "0",
  9. "filter": {
  10. "evaltype": "0",
  11. "formula": "",
  12. "conditions": [
  13. {
  14. "type": "3",
  15. "oldtag": "error",
  16. "newtag": "ok",
  17. "formulaid": "A"
  18. }
  19. ],
  20. "eval_formula": "A"
  21. },
  22. "operations": [
  23. {
  24. "type": "0"
  25. }
  26. ]
  27. }
  28. ],
  29. "id": 1
  30. }

See also

Source

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