dots.v2.databases.byDatabase_cluster_uuid().logsink.post()
Generated on 5 Nov 2026
from DoTs version
v1.23.0
Usage
client.v2.databases.byDatabase_cluster_uuid(database_cluster_uuid).logsink.post(body: Logsink_create, requestConfiguration?: RequestConfiguration<object>): Promise<undefined | LogsinkPostResponse>Description
To create logsink for a database cluster, send a POST request to
/v2/databases/{database_cluster_uuid}/logsink.
Parameters
Path Parameters
database_cluster_uuidstring requiredExample:
9cc10173-e9ea-4176-9dbc-a4cee4c4ff30A unique identifier for a database cluster.
Request Body
sinkNamestring requiredExample:
prod-logsinkThe name of the Logsink
sinkTypestring requiredType of logsink integration.
- Usedatadogfor Datadog integration only with MongoDB clusters.
- For non-MongoDB clusters, usersyslogfor general syslog forwarding.
- Other supported types includeelasticsearchandopensearch.
More details about the configuration can be found in theconfigproperty.configobject requiredShow child properties
serverstring optionalExample:
192.168.0.1DNS name or IPv4 address of the rsyslog server
portinteger optionalExample:
514The internal port on which the rsyslog server is listening
tlsboolean optionalExample:
falseUse TLS (as the messages are not filtered and may contain sensitive information, it is highly recommended to set this to true if the remote server supports it)
formatstring optionalMessage format used by the server, this can be either rfc3164 (the old BSD style message format),
rfc5424(current syslog message format) or customloglinestring optionalExample:
<%pri%>%timestamp:::date-rfc3339% %HOSTNAME% %app-name% %msg%Conditional (required if
format==custom).
Syslog log line template for a custom format, supporting limited rsyslog style templating (using%tag%). Supported tags are:HOSTNAME,app-name,msg,msgid,pri,procid,structured-data,timestampandtimestamp:::date-rfc3339.
---
Datadog Integration Example for Non-Mongo clusters:
```
DD_KEY <%pri%>1 %timestamp:::date-rfc3339% %HOSTNAME%.DB_NAME %app-name% - - - %msg%DD_KEY
- Replacewith your actual Datadog API key.DB_NAME
- Replacewith the actual name of your database cluster.intake.logs.datadoghq.com
- Configure the Server:
- US Region: Usetcp-intake.logs.datadoghq.eu
- EU Region: Use10516
- Configure the Port:
- US Region: Use port443
- EU Region: Use portdatadog_logsink` integration instead.
- Enable TLS:
- Ensure the TLS checkbox is enabled.
- Note: This configuration applies to **non-Mongo clusters only**. For **Mongo clusters**, use thesdstring optionalExample:
TOKEN tag="LiteralValue"content of the structured data block of rfc5424 message
castring optionalExample:
-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----\nPEM encoded CA certificate
keystring optional(PEM format) client key if the server requires client authentication
certstring optionalExample:
-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----\n(PEM format) client cert to use
urlstring optionalExample:
https://user:[email protected]:9200Elasticsearch connection URL
indexPrefixstring optionalExample:
elastic-logsElasticsearch index prefix
indexDaysMaxinteger optionalExample:
5Maximum number of days of logs to keep
timeoutnumber optionalExample:
10Elasticsearch request timeout limit
sitestring optionalExample:
http-intake.logs.datadoghq.comDatadog connection URL
datadogApiKeystring optionalExample:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxDatadog API key
Request Sample
Response Example
More Information
See /v2/databases/{database_cluster_uuid}/logsink in the API reference for additional detail on responses, headers, parameters, and more.