pydo.databases.create_logsink()
Generated on 8 May 2026
from pydo version
v0.34.0
Usage
client.databases.create_logsink(
database_cluster_uuid="9cc10173-e9ea-4176-9dbc-a4cee4c4ff30",
body={
"sink_name": "prod-logsink",
"sink_type": "rsyslog",
"config": {...},
},
)Description
To create logsink for a database cluster, send a POST request to
/v2/databases/{database_cluster_uuid}/logsink.
Parameters
database_cluster_uuidstring requiredA unique identifier for a database cluster.
sink_namestring requiredExample:
prod-logsinkThe name of the Logsink
sink_typestring 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 optionalExample:
-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n(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]:9200Opensearch connection URL
index_prefixstring optionalExample:
opensearch-logsOpensearch index prefix
index_days_maxinteger optionalExample:
5Maximum number of days of logs to keep
timeoutnumber optionalExample:
10Opensearch request timeout limit
sitestring optionalExample:
http-intake.logs.datadoghq.comDatadog connection URL
datadog_api_keystring 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.