{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"To create logsink for a database cluster, send a POST request to\n`/v2/databases/$DATABASE_ID/logsink`.\n","properties":{"path":{"type":"object","properties":{"database_cluster_uuid":{"type":"string","format":"uuid","examples":["9cc10173-e9ea-4176-9dbc-a4cee4c4ff30"],"description":"A unique identifier for a database cluster."}},"required":["database_cluster_uuid"],"additionalProperties":false},"body":{"allOf":[{"$ref":"#/definitions/logsink_create"}],"required":["sink_name","sink_type","config"],"examples":[{"sink_name":"logs-sink","sink_type":"opensearch","config":{"url":"https://user:passwd@192.168.0.1:25060","index_prefix":"opensearch-logs","index_days_max":5}}]}},"required":["path","body"],"additionalProperties":false,"definitions":{"logsink_create":{"type":"object","allOf":[{"$ref":"#/definitions/logsink_base"},{"properties":{"config":{"anyOf":[{"$ref":"#/definitions/rsyslog_logsink"},{"$ref":"#/definitions/elasticsearch_logsink"},{"$ref":"#/definitions/opensearch_logsink"},{"$ref":"#/definitions/datadog_logsink"}]}}}]},"logsink_base":{"type":"object","properties":{"sink_name":{"type":"string","description":"The name of the Logsink","examples":["prod-logsink"]},"sink_type":{"type":"string","enum":["rsyslog","elasticsearch","opensearch","datadog"],"description":"Type of logsink integration.\n\n- Use `datadog` for Datadog integration **only with MongoDB clusters**.\n- For non-MongoDB clusters, use `rsyslog` for general syslog forwarding.\n- Other supported types include `elasticsearch` and `opensearch`.\n\nMore details about the configuration can be found in the `config` property.\n","examples":["rsyslog"]}}},"rsyslog_logsink":{"type":"object","properties":{"server":{"type":"string","description":"DNS name or IPv4 address of the rsyslog server","examples":["192.168.0.1"]},"port":{"type":"integer","maximum":65535,"description":"The internal port on which the rsyslog server is listening","examples":[514]},"tls":{"type":"boolean","description":"Use 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)","examples":[false]},"format":{"type":"string","enum":["rfc5424","rfc3164","custom"],"description":"Message format used by the server, this can be either rfc3164 (the old BSD style message format), `rfc5424` (current syslog message format) or custom","examples":["rfc5424"]},"logline":{"type":"string","description":"Conditional (required if `format` == `custom`).\n\nSyslog 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`, `timestamp` and `timestamp:::date-rfc3339`.\n\n---\n**Datadog Integration Example for Non-Mongo clusters**:\n```\nDD_KEY <%pri%>1 %timestamp:::date-rfc3339% %HOSTNAME%.DB_NAME %app-name% - - - %msg%\n```\n- Replace `DD_KEY` with your actual Datadog API key.\n- Replace `DB_NAME` with the actual name of your database cluster.\n- Configure the Server:\n  - US Region: Use `intake.logs.datadoghq.com`\n  - EU Region: Use `tcp-intake.logs.datadoghq.eu`\n- Configure the Port:\n  - US Region: Use port `10516`\n  - EU Region: Use port `443`\n- Enable TLS:\n  - Ensure the TLS checkbox is enabled.\n- Note: This configuration applies to **non-Mongo clusters only**. For **Mongo clusters**, use the `datadog_logsink` integration instead.\n","examples":["<%pri%>%timestamp:::date-rfc3339% %HOSTNAME% %app-name% %msg%"]},"sd":{"type":"string","description":"content of the structured data block of rfc5424 message","examples":["TOKEN tag=\"LiteralValue\""]},"ca":{"type":"string","description":"PEM encoded CA certificate","examples":["-----BEGIN CERTIFICATE-----\\n...\\n-----END CERTIFICATE-----\\n"]},"key":{"type":"string","description":"(PEM format) client key if the server requires client authentication","examples":["-----BEGIN PRIVATE KEY-----\\n...\\n-----END PRIVATE KEY-----\\n"]},"cert":{"type":"string","description":"(PEM format) client cert to use","examples":["-----BEGIN CERTIFICATE-----\\n...\\n-----END CERTIFICATE-----\\n"]}},"required":["server","port","tls","format"]},"elasticsearch_logsink":{"type":"object","properties":{"url":{"type":"string","description":"Elasticsearch connection URL","examples":["https://user:passwd@192.168.0.1:9200"]},"index_prefix":{"type":"string","description":"Elasticsearch index prefix","examples":["elastic-logs"]},"index_days_max":{"type":"integer","default":7,"maximum":10000,"minimum":1,"description":"Maximum number of days of logs to keep","examples":[5]},"timeout":{"type":"number","default":10,"minimum":10,"maximum":120,"description":"Elasticsearch request timeout limit","examples":[10]},"ca":{"type":"string","description":"PEM encoded CA certificate","examples":["-----BEGIN CERTIFICATE-----\\n...\\n-----END CERTIFICATE-----\\n"]}},"required":["url","index_prefix"]},"opensearch_logsink":{"type":"object","properties":{"url":{"type":"string","description":"Opensearch connection URL","examples":["https://user:passwd@192.168.0.1:9200"]},"index_prefix":{"type":"string","description":"Opensearch index prefix","examples":["opensearch-logs"]},"index_days_max":{"type":"integer","default":7,"maximum":10000,"minimum":1,"description":"Maximum number of days of logs to keep","examples":[5]},"timeout":{"type":"number","default":10,"minimum":10,"maximum":120,"description":"Opensearch request timeout limit","examples":[10]},"ca":{"type":"string","description":"PEM encoded CA certificate","examples":["-----BEGIN CERTIFICATE-----\\n...\\n-----END CERTIFICATE-----\\n"]}},"required":["url","index_prefix"]},"datadog_logsink":{"type":"object","description":"Configuration for Datadog integration **applicable only to MongoDB clusters**.\n","properties":{"site":{"type":"string","description":"Datadog connection URL","examples":["http-intake.logs.datadoghq.com"]},"datadog_api_key":{"type":"string","description":"Datadog API key","examples":["xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"]}},"required":["site","datadog_api_key"]}}},"name":"Create Logsink for a Database Cluster\n","id":"digitalocean.databases_create_logsink","example":{"path":{"database_cluster_uuid":"9cc10173-e9ea-4176-9dbc-a4cee4c4ff30"},"body":{"sink_name":"logs-sink","sink_type":"opensearch","config":{"url":"https://user:passwd@192.168.0.1:25060","index_prefix":"opensearch-logs","index_days_max":5}}},"maxRequests":1,"summary":false}}