Skip to main content

historical_jobs

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

Overview

Namehistorical_jobs
TypeResource
Iddatadog.security.historical_jobs

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringID of the job.
attributesobjectHistorical job attributes.
typestringType of payload. (historicalDetectionsJob)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_historical_jobselectjob_idGet a job's details.
list_historical_jobsselectpage[size], page[number], sort, filter[query]List historical jobs.
run_historical_jobinsertRun a historical job.
cancel_historical_jobupdatejob_idCancel a historical job.
delete_historical_jobdeletejob_idDelete an existing job.

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
job_idstringThe ID of the job.
sitestringThe Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both.
filter[query]stringQuery used to filter items from the fetched list. (example: security:attack status:high)
page[number]integer (int64)Specific page number to return.
page[size]integer (int64)Number of items to return per page. The maximum allowed value is 100.
sortstringThe order of the jobs in results. (example: status)

SELECT examples

Get a job's details.

SELECT
id,
attributes,
type
FROM datadog.security.historical_jobs
WHERE job_id = '{{ job_id }}' -- required
;

INSERT examples

Run a historical job.

INSERT INTO datadog.security.historical_jobs (
data
)
SELECT
'{{ data }}'
RETURNING
data
;

UPDATE examples

Cancel a historical job.

UPDATE datadog.security.historical_jobs
SET
-- No updatable properties
WHERE
job_id = '{{ job_id }}' --required;

DELETE examples

Delete an existing job.

DELETE FROM datadog.security.historical_jobs
WHERE job_id = '{{ job_id }}' --required
;