log_delivery
Creates, updates, deletes, gets or lists a log_delivery resource.
Overview
| Name | log_delivery |
| Type | Resource |
| Id | databricks_account.billing.log_delivery |
Fields
The following fields are returned by SELECT queries:
- log_delivery_get
- log_delivery_list
| Name | Datatype | Description |
|---|---|---|
account_id | string | Databricks account ID. |
config_id | string | The unique UUID of log delivery configuration |
credentials_id | string | The 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_id | string | The 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_name | string | The optional human-readable name of the log delivery configuration. Defaults to empty. |
creation_time | integer | Time in epoch milliseconds when the log delivery configuration was created. |
delivery_path_prefix | string | The 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_time | string | This 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_status | object | The LogDeliveryStatus of this log delivery configuration |
log_type | string | Log 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_format | string | The 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) |
status | string | Status 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_time | integer | Time in epoch milliseconds when the log delivery configuration was updated. |
workspace_ids_filter | array | Optional 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. |
| Name | Datatype | Description |
|---|---|---|
account_id | string | Databricks account ID. |
config_id | string | The unique UUID of log delivery configuration |
credentials_id | string | The 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_id | string | The 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_name | string | The optional human-readable name of the log delivery configuration. Defaults to empty. |
creation_time | integer | Time in epoch milliseconds when the log delivery configuration was created. |
delivery_path_prefix | string | The 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_time | string | This 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_status | object | The LogDeliveryStatus of this log delivery configuration |
log_type | string | Log 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_format | string | The 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) |
status | string | Status 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_time | integer | Time in epoch milliseconds when the log delivery configuration was updated. |
workspace_ids_filter | array | Optional 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
log_delivery_get | select | account_id, log_delivery_configuration_id | Gets a Databricks log delivery configuration object for an account, both specified by ID. | |
log_delivery_list | select | account_id | credentials_id, page_token, status, storage_configuration_id | Gets all Databricks log delivery configurations associated with an account specified by ID. |
log_delivery_create | insert | account_id, log_delivery_configuration | Creates a new Databricks log delivery configuration to enable delivery of the specified type of logs | |
log_delivery_patch_status | update | account_id, log_delivery_configuration_id, status | Enables 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.
| Name | Datatype | Description |
|---|---|---|
account_id | string | |
log_delivery_configuration_id | string | The log delivery configuration id of customer |
credentials_id | string | The Credentials id to filter the search results with |
page_token | string | A 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. |
status | string | The log delivery status to filter the search results with |
storage_configuration_id | string | The Storage Configuration id to filter the search results with |
SELECT examples
- log_delivery_get
- log_delivery_list
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
;
Gets all Databricks log delivery configurations associated with an account 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 credentials_id = '{{ credentials_id }}'
AND page_token = '{{ page_token }}'
AND status = '{{ status }}'
AND storage_configuration_id = '{{ storage_configuration_id }}'
;
INSERT examples
- log_delivery_create
- Manifest
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
;
# Description fields are for documentation purposes
- name: log_delivery
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the log_delivery resource.
- name: log_delivery_configuration
description: |
:returns: :class:`WrappedLogDeliveryConfiguration`
value:
log_type: "{{ log_type }}"
output_format: "{{ output_format }}"
credentials_id: "{{ credentials_id }}"
storage_configuration_id: "{{ storage_configuration_id }}"
config_name: "{{ config_name }}"
delivery_path_prefix: "{{ delivery_path_prefix }}"
delivery_start_time: "{{ delivery_start_time }}"
status: "{{ status }}"
workspace_ids_filter:
- {{ workspace_ids_filter }}
UPDATE examples
- log_delivery_patch_status
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;