TrueSight API Documentation
OverviewAccountActionsAdministration
Alarms v1Alarms v2BatchingDashboards
DatasetsEventsExtended Metrics
GroupsHostgroupsMetersMetricsProduct
PluginsRelaysSourcesSource-TagsSynchronize Data
Tenants
Terms

POST/v1/events

Creates an event. Every event occurrence is persisted to the database as a RawEvent. Based on the EventFingerprint, a new Event will be created or an existing one will be de-duplicated.

Request body

RawEvent

Example request

curl https://api.truesight.bmc.com/v1/events \
-X POST \
-u <email>:<api-token> \
-H "Content-Type: application/json" \
-d '
{
   "fingerprintFields": [
      "@title"
   ],
   "source": {
      "ref": "mymeter",
      "type": "host"
   },
   "message": "my message",
   "title": "My title",
   "properties": {
      "foo": "bar",
      "baz": 42
   },
   "severity": "INFO",
   "status": "OPEN",
   "tags": [
      "tag1",
      "tag2"
   ]
}'

Return value

In case of a valid event returns HTTP 202 Accepted.

{
   "result": {
      "sent": 1,
      "success": "true",
      "accepted": [
         {
            "index": 0,
            "id": "ab12cd34e5"
         }
      ]
   }
}

In case of a invalid event returns HTTP 400 Bad Request.

{
   "result": {
      "sent": 0,
      "success": "false",
      "errors": [
         {
            "index": 0,
            "message": "The required field was missing: [title] "
         }
      ]
   }
}

Bulk Event Ingestion

Creates list of events.

Request body

Pass an array of RawEvent for the request body.

Example request

curl https://api.truesight.bmc.com/v1/events \
-X POST \
-u <email>:<api-token> \
-H "Content-Type: application/json" \
-d '
[
   {
      "fingerprintFields": [
         "@title"
      ],
      "source": {
         "ref": "mymeter",
         "type": "host"
      },
      "message": "my message",
      "title": "My title",
      "properties": {
         "foo": "bar",
         "baz": 42
      },
      "severity": "INFO",
      "status": "OPEN",
      "tags": [
         "tag1",
         "tag2"
      ]
   },
   {
      "fingerprintFields": [
         "@title"
      ],
      "source": {
         "ref": "mymeter",
         "type": "host"
      },
      "message": "my message2",
      "title": "My title2",
      "properties": {
         "foo": "bar",
         "baz": 42
      },
      "severity": "INFO",
      "status": "OPEN",
      "tags": [
         "tag1",
         "tag2"
      ]
   }
]'

Return value

In case of all valid events returns HTTP 202 Accepted.

{
   "result": {
      "sent": 2,
      "success": "true",
      "accepted": [
         {
            "index": 0,
            "id": "ab12cd34e5"
         },
         {
            "index": 1,
            "id": "fg67hi89j1"
         }
      ]
   }
}

In case of at least one valid event returns HTTP 202 Accepted.

{
   "result": {
      "sent": 1,
      "success": "partial",
      "errors": [
         {
            "index": 0,
            "message": "The required field was missing: [title] "
         }
      ],
      "accepted": [
         {
            "index": 1,
            "id": "ab12cd34e5"
         }
      ]
   }
}

In case of all invalid events returns HTTP 400 Bad Request.

{
   "result": {
      "sent": 0,
      "success": "false",
      "errors": [
         {
            "index": 0,
            "message": "The required field was missing: [title] "
         },
         {
            "index": 1,
            "message": "The required field was missing: [title] "
         }
      ]
   }
}

Note: In the response, "index" represents the nth element in the array of the request body and "id" represents the eventId with which user can query back the event.