v8

latestOpenAPI 3.0.0Apache 2.0raw.githubusercontent.com2025-10-165266542.4 MB
DigitalOcean-public.v2-new_Databases

Create Logsink for a Database Cluster

To create logsink for a database cluster, send a POST request to /v2/databases/$DATABASE_ID/logsink.

post/v2/databases/{database_cluster_uuid}/logsink

Path parameters

database_cluster_uuidstring uuid required

A unique identifier for a database cluster.

Request body

sink_namestring

The name of the Logsink

sink_type'rsyslog' | 'elasticsearch' | 'opensearch' | 'datadog'

Type of logsink integration.

  • Use datadog for Datadog integration only with MongoDB clusters.
  • For non-MongoDB clusters, use rsyslog for general syslog forwarding.
  • Other supported types include elasticsearch and opensearch.

More details about the configuration can be found in the config property.

Example request

{
  "sink_name": "prod-logsink",
  "sink_type": "rsyslog",
  "config": {
    "server": "192.168.0.1",
    "port": 514,
    "format": "rfc5424",
    "logline": "<%pri%>%timestamp:::date-rfc3339% %HOSTNAME% %app-name% %msg%",
    "sd": "TOKEN tag=\"LiteralValue\"",
    "ca": "-----BEGIN CERTIFICATE-----\\n...\\n-----END CERTIFICATE-----\\n",
    "key": "-----BEGIN PRIVATE KEY-----\\n...\\n-----END PRIVATE KEY-----\\n",
    "cert": "-----BEGIN CERTIFICATE-----\\n...\\n-----END CERTIFICATE-----\\n"
  }
}

Response

A JSON object with a key of sink.

Example response

{
  "sink": {
    "sink_id": "dfcc9f57d86bf58e321c2c6c31c7a971be244ac7",
    "sink_name": "prod-logsink",
    "sink_type": "rsyslog",
    "config": {
      "server": "192.168.0.1",
      "port": 514,
      "format": "rfc5424",
      "logline": "<%pri%>%timestamp:::date-rfc3339% %HOSTNAME% %app-name% %msg%",
      "sd": "TOKEN tag=\"LiteralValue\"",
      "ca": "-----BEGIN CERTIFICATE-----\\n...\\n-----END CERTIFICATE-----\\n",
      "key": "-----BEGIN PRIVATE KEY-----\\n...\\n-----END PRIVATE KEY-----\\n",
      "cert": "-----BEGIN CERTIFICATE-----\\n...\\n-----END CERTIFICATE-----\\n"
    }
  }
}