Skip to main content

integration_log_drains

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

Overview​

Nameintegration_log_drains
TypeResource
Idvercel.log_drains.integration_log_drains

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe unique identifier of the log drain. Always prefixed with ld_ (example: ld_nBuA7zCID8g4QZ8g)
namestringThe name of the log drain (example: My first log drain)
client_idstringThe oauth2 client application id that created this log drain (example: oac_xRhY4LAB7yLhUADD69EvV7ct) (wire: clientId)
configuration_idstringThe client configuration this log drain was created with (example: icfg_3bwCLgxL8qt5kjRLcv2Dit7F) (wire: configurationId)
owner_idstringThe identifier of the team or user whose events will trigger the log drain (example: kr1PsOIzqEL5Xg6M4VZcZosf) (wire: ownerId)
project_idstring (example: AbCgVkqoxXeXCDWehVir51LHGrrcWL4mkYm14W6UBPWQeb) (wire: projectId)
branchstringThe branch regexp of log drain (example: feature/*)
created_atnumberA timestamp that tells you when the log drain was created (wire: createdAt)
created_fromstringWhether the log drain was created by an integration or by a user (integration, self-served) (example: integration) (wire: createdFrom)
delivery_formatstringThe delivery log format (json, ndjson, protobuf) (example: json) (wire: deliveryFormat)
environmentsarrayThe environment of log drain
headersobjectThe headers to send with the request (example: {"Authorization": "Bearer 123"})
project_idsarrayThe identifier of the projects this log drain is associated with (example: AbCgVkqoxXeXCDWehVir51LHGrrcWL4mkYm14W6UBPWQeb) (wire: projectIds)
sampling_ratenumberThe sampling rate of log drain (wire: samplingRate)
source
sourcesarrayThe sources from which logs are currently being delivered to this log drain.
urlstringThe URL to call when logs are generated (example: https:​//example.com/log-drain)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectteam_id, slugRetrieves a list of all Integration log drains that are defined for the authenticated user or team. When using an OAuth2 token, the list is limited to log drains created by the authenticated integration.
createinsertname, urlteam_id, slugCreates an Integration log drain. This endpoint must be called with an OAuth2 client (integration), since log drains are tied to integrations. If it is called with a different token type it will produce a 400 error.
deletedeleteidteam_id, slugDeletes the Integration log drain with the provided id. When using an OAuth2 Token, the log drain can be deleted only if the integration owns it.

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
idstringID of the log drain to be deleted
slugstringThe Team slug to perform the request on behalf of.
team_idstringThe Team identifier to perform the request on behalf of. (wire: teamId)

SELECT examples​

Retrieves a list of all Integration log drains that are defined for the authenticated user or team. When using an OAuth2 token, the list is limited to log drains created by the authenticated integration.

SELECT
id,
name,
client_id,
configuration_id,
owner_id,
project_id,
branch,
created_at,
created_from,
delivery_format,
environments,
headers,
project_ids,
sampling_rate,
source,
sources,
url
FROM vercel.log_drains.integration_log_drains
WHERE team_id = '{{ team_id }}'
AND slug = '{{ slug }}'
;

INSERT examples​

Creates an Integration log drain. This endpoint must be called with an OAuth2 client (integration), since log drains are tied to integrations. If it is called with a different token type it will produce a 400 error.

INSERT INTO vercel.log_drains.integration_log_drains (
name,
project_ids,
secret,
delivery_format,
url,
sources,
headers,
environments,
team_id,
slug
)
SELECT
'{{ name }}' /* required */,
'{{ project_ids }}',
'{{ secret }}',
'{{ delivery_format }}',
'{{ url }}' /* required */,
'{{ sources }}',
'{{ headers }}',
'{{ environments }}',
'{{ team_id }}',
'{{ slug }}'
RETURNING
id,
name,
client_id,
configuration_id,
owner_id,
project_id,
branch,
created_at,
created_from,
delivery_format,
environments,
headers,
project_ids,
sampling_rate,
source,
sources,
url
;

DELETE examples​

Deletes the Integration log drain with the provided id. When using an OAuth2 Token, the log drain can be deleted only if the integration owns it.

DELETE FROM vercel.log_drains.integration_log_drains
WHERE id = '{{ id }}' --required
AND team_id = '{{ team_id }}'
AND slug = '{{ slug }}'
;