Skip to main content

log_delivery

Creates, updates, deletes, gets or lists a log_delivery resource.

Overview

Namelog_delivery
TypeResource
Iddatabricks_account.billing.log_delivery

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
account_idstringDatabricks account ID.
config_idstringThe unique UUID of log delivery configuration
credentials_idstringThe ID for a method:credentials/create that represents the AWS IAM role with policy and trust relationship as described in the main billable usage documentation page. See [Configure billable usage delivery]. [Configure billable usage delivery]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html
storage_configuration_idstringThe ID for a method:storage/create that represents the S3 bucket with bucket policy as described in the main billable usage documentation page. See [Configure billable usage delivery]. [Configure billable usage delivery]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html
config_namestringThe optional human-readable name of the log delivery configuration. Defaults to empty.
creation_timeintegerTime in epoch milliseconds when the log delivery configuration was created.
delivery_path_prefixstringThe optional delivery path prefix within Amazon S3 storage. Defaults to empty, which means that logs are delivered to the root of the bucket. This must be a valid S3 object key. This must not start or end with a slash character.
delivery_start_timestringThis field applies only if log_type is BILLABLE_USAGE. This is the optional start month and year for delivery, specified in YYYY-MM format. Defaults to current year and month. BILLABLE_USAGE logs are not available for usage before March 2019 (2019-03).
log_delivery_statusobjectThe LogDeliveryStatus of this log delivery configuration
log_typestringLog delivery type. Supported values are: * `BILLABLE_USAGE` — Configure [billable usage log delivery]. For the CSV schema, see the [View billable usage]. * `AUDIT_LOGS` — Configure [audit log delivery]. For the JSON schema, see [Configure audit logging] [Configure audit logging]: https://docs.databricks.com/administration-guide/account-settings/audit-logs.html [View billable usage]: https://docs.databricks.com/administration-guide/account-settings/usage.html [audit log delivery]: https://docs.databricks.com/administration-guide/account-settings/audit-logs.html [billable usage log delivery]: https://docs.databricks.com/administration-guide/account-settings/billable-usage-delivery.html (AUDIT_LOGS, BILLABLE_USAGE)
output_formatstringThe file type of log delivery. * If `log_type` is `BILLABLE_USAGE`, this value must be `CSV`. Only the CSV (comma-separated values) format is supported. For the schema, see the [View billable usage] * If `log_type` is `AUDIT_LOGS`, this value must be `JSON`. Only the JSON (JavaScript Object Notation) format is supported. For the schema, see the [Configuring audit logs]. [Configuring audit logs]: https://docs.databricks.com/administration-guide/account-settings/audit-logs.html [View billable usage]: https://docs.databricks.com/administration-guide/account-settings/usage.html (CSV, JSON)
statusstringStatus of log delivery configuration. Set to `ENABLED` (enabled) or `DISABLED` (disabled). Defaults to `ENABLED`. You can [enable or disable the configuration](#operation/patch-log-delivery-config-status) later. Deletion of a configuration is not supported, so disable a log delivery configuration that is no longer needed. (DISABLED, ENABLED)
update_timeintegerTime in epoch milliseconds when the log delivery configuration was updated.
workspace_ids_filterarrayOptional filter that specifies workspace IDs to deliver logs for. By default the workspace filter is empty and log delivery applies at the account level, delivering workspace-level logs for all workspaces in your account, plus account level logs. You can optionally set this field to an array of workspace IDs (each one is an `int64`) to which log delivery should apply, in which case only workspace-level logs relating to the specified workspaces are delivered. If you plan to use different log delivery configurations for different workspaces, set this field explicitly. Be aware that delivery configurations mentioning specific workspaces won't apply to new workspaces created in the future, and delivery won't include account level logs. For some types of Databricks deployments there is only one workspace per account ID, so this field is unnecessary.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
log_delivery_getselectaccount_id, log_delivery_configuration_idGets a Databricks log delivery configuration object for an account, both specified by ID.
log_delivery_listselectaccount_idcredentials_id, page_token, status, storage_configuration_idGets all Databricks log delivery configurations associated with an account specified by ID.
log_delivery_createinsertaccount_id, log_delivery_configurationCreates a new Databricks log delivery configuration to enable delivery of the specified type of logs
log_delivery_patch_statusupdateaccount_id, log_delivery_configuration_id, statusEnables or disables a log delivery configuration. Deletion of delivery configurations is not

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
account_idstring
log_delivery_configuration_idstringThe log delivery configuration id of customer
credentials_idstringThe Credentials id to filter the search results with
page_tokenstringA page token received from a previous get all budget configurations call. This token can be used to retrieve the subsequent page. Requests first page if absent.
statusstringThe log delivery status to filter the search results with
storage_configuration_idstringThe Storage Configuration id to filter the search results with

SELECT examples

Gets a Databricks log delivery configuration object for an account, both specified by ID.

SELECT
account_id,
config_id,
credentials_id,
storage_configuration_id,
config_name,
creation_time,
delivery_path_prefix,
delivery_start_time,
log_delivery_status,
log_type,
output_format,
status,
update_time,
workspace_ids_filter
FROM databricks_account.billing.log_delivery
WHERE account_id = '{{ account_id }}' -- required
AND log_delivery_configuration_id = '{{ log_delivery_configuration_id }}' -- required
;

INSERT examples

Creates a new Databricks log delivery configuration to enable delivery of the specified type of logs

INSERT INTO databricks_account.billing.log_delivery (
log_delivery_configuration,
account_id
)
SELECT
'{{ log_delivery_configuration }}' /* required */,
'{{ account_id }}'
RETURNING
log_delivery_configuration
;

UPDATE examples

Enables or disables a log delivery configuration. Deletion of delivery configurations is not

UPDATE databricks_account.billing.log_delivery
SET
status = '{{ status }}'
WHERE
account_id = '{{ account_id }}' --required
AND log_delivery_configuration_id = '{{ log_delivery_configuration_id }}' --required
AND status = '{{ status }}' --required;