Skip to main content

archives

Creates, updates, deletes, gets or lists an archives resource.

Overview

Namearchives
TypeResource
Iddatadog.logs.archives

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe archive ID. (example: a2zcMylnM4OCHpYusxIi3g)
attributesobjectThe attributes associated with the archive.
typestringThe type of the resource. The value should always be archives. (default: archives, example: archives)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_logs_archiveselectarchive_id, regionGet a specific archive from your organization.
list_logs_archivesselectregionGet the list of configured logs archives with their definitions.
create_logs_archiveinsertregionCreate an archive in your organization.
update_logs_archivereplacearchive_id, regionUpdate a given archive configuration.

Note: Using this method updates your archive configuration by replacing
your current configuration with the new one sent to your Datadog organization.
delete_logs_archivedeletearchive_id, regionDelete a given archive from your organization.

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
archive_idstringThe ID of the archive.
regionstring(default: datadoghq.com)

SELECT examples

Get a specific archive from your organization.

SELECT
id,
attributes,
type
FROM datadog.logs.archives
WHERE archive_id = '{{ archive_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Create an archive in your organization.

INSERT INTO datadog.logs.archives (
data__data,
region
)
SELECT
'{{ data }}',
'{{ region }}'
RETURNING
data
;

REPLACE examples

Update a given archive configuration.

Note: Using this method updates your archive configuration by replacing
your current configuration with the new one sent to your Datadog organization.

REPLACE datadog.logs.archives
SET
data__data = '{{ data }}'
WHERE
archive_id = '{{ archive_id }}' --required
AND region = '{{ region }}' --required
RETURNING
data;

DELETE examples

Delete a given archive from your organization.

DELETE FROM datadog.logs.archives
WHERE archive_id = '{{ archive_id }}' --required
AND region = '{{ region }}' --required
;