Skip to main content
node
const fetch = require('node-fetch');

let url = 'https://api.coralogix.com/mgmt/openapi/v3/alert-defs';

let options = {method: 'GET', headers: {Authorization: 'Bearer <API_KEY>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error('error:' + err));
{
  "alertDefs": [
    {
      "alertDefProperties": {
        "activeOn": {
          "dayOfWeek": [
            "DAY_OF_WEEK_MONDAY_OR_UNSPECIFIED"
          ],
          "endTime": {
            "hours": 14,
            "minutes": 30
          },
          "startTime": {
            "hours": 14,
            "minutes": 30
          }
        },
        "deleted": false,
        "description": "Alert description",
        "enabled": true,
        "entityLabels": [
          {
            "key": "<string>",
            "value": "<string>"
          }
        ],
        "groupByKeys": [
          [
            "key1",
            "key2"
          ]
        ],
        "incidentsSettings": {
          "minutes": 30,
          "notifyOn": "NOTIFY_ON_TRIGGERED_ONLY_UNSPECIFIED"
        },
        "logsImmediate": {
          "logsFilter": {
            "simpleFilter": {
              "labelFilters": {
                "applicationName": "<any>",
                "severities": "<any>",
                "subsystemName": "<any>"
              },
              "luceneQuery": "<string>"
            }
          },
          "notificationPayloadFilter": [
            [
              "obj.field"
            ]
          ]
        },
        "name": "My Alert",
        "notificationGroup": {
          "destinations": [
            {
              "connectorId": "<any>",
              "notifyOn": "<any>",
              "presetId": "<any>",
              "resolvedRouteOverrides": "<any>",
              "triggeredRoutingOverrides": "<any>"
            }
          ],
          "groupByKeys": [
            [
              "key1",
              "key2"
            ]
          ],
          "router": {
            "id": "123e4567-e89b-12d3-a456-426614174000",
            "notifyOn": "NOTIFY_ON_TRIGGERED_ONLY_UNSPECIFIED"
          },
          "webhooks": [
            {
              "integration": "<any>",
              "minutes": "<any>",
              "notifyOn": "<any>"
            }
          ]
        },
        "notificationGroupExcess": [
          {
            "destinations": [
              {
                "connectorId": "<any>",
                "notifyOn": "<any>",
                "presetId": "<any>",
                "resolvedRouteOverrides": "<any>",
                "triggeredRoutingOverrides": "<any>"
              }
            ],
            "groupByKeys": [
              [
                "key1",
                "key2"
              ]
            ],
            "router": {
              "id": "123e4567-e89b-12d3-a456-426614174000",
              "notifyOn": "NOTIFY_ON_TRIGGERED_ONLY_UNSPECIFIED"
            },
            "webhooks": [
              {
                "integration": "<any>",
                "minutes": "<any>",
                "notifyOn": "<any>"
              }
            ]
          }
        ],
        "phantomMode": false,
        "priority": "ALERT_DEF_PRIORITY_P5_OR_UNSPECIFIED",
        "type": "ALERT_DEF_TYPE_LOGS_IMMEDIATE_OR_UNSPECIFIED"
      },
      "alertVersionId": "<string>",
      "createdTime": "2023-10-01T12:00:00.000Z",
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "lastTriggeredTime": "2023-10-01T12:00:00.000Z",
      "status": "ALERT_DEF_STATUS_UNSPECIFIED",
      "updatedTime": "2023-10-01T12:00:00.000Z"
    }
  ],
  "pagination": {
    "nextPageToken": "<string>",
    "totalSize": 123
  }
}

Authorizations

Authorization
string
header
required

API key authentication

Response

A response that contains a list of alert definitions

alertDefs
Alert definition · object[]
required
pagination
object
I