Skip to main content

log_services

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

Overview​

Namelog_services
TypeResource
Idfivetran.external_logging.log_services

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe unique identifier for the log service within the Fivetran system. (example: log_id)
configobjectThe config object for the service in question (a JSON value; its keys depend on the service). The accepted keys per type are documented in the vendor's API reference and returned by the connector metadata endpoints.
enabledbooleanThe boolean value specifying whether the log service is enabled.
servicestringThe name of the log service type within the Fivetran system. We support the following log services: azure_monitor_log, cloudwatch, datadog_log, dynatrace, grafana_loki, splunkLog, new_relic_log, stackdriver (Google Cloud Logging). (example: log_service_type)
setup_testsarrayResults of the most recent setup test run.
statusobjectSetup status of the log service. Present when a setup status exists for the log service.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectlog_idReturns a group-level [logging service](https:​//fivetran.com/docs/logs/external-logs) object if a valid identifier was provided.
listselectcursor, limitReturns a list of all accessible [logging services](https:​//fivetran.com/docs/logs/external-logs) within your Fivetran account.
createinsertCreates a new group-level [logging service](https:​//fivetran.com/docs/logs/external-logs) within a specified group in your Fivetran account.
updateupdatelog_idUpdates information for an existing group-level [logging service](https:​//fivetran.com/docs/logs/external-logs) within your Fivetran account.
deletedeletelog_idDeletes a group-level [logging service](https:​//fivetran.com/docs/logs/external-logs) from your Fivetran account.
run_setup_testsexeclog_idRuns the setup tests for an existing group-level [logging service](https:​//fivetran.com/docs/logs/external-logs) within your Fivetran account.

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
log_idstringThe unique identifier for the log service within the Fivetran system.
cursorstringPaging cursor, [read more about pagination](https:​//fivetran.com/docs/rest-api/pagination)
limitinteger (int32)Number of records to fetch per page. Accepts a number in the range 1..1000; the default value is 100.

SELECT examples​

Returns a group-level logging service object if a valid identifier was provided.

SELECT
id,
config,
enabled,
service,
setup_tests,
status
FROM fivetran.external_logging.log_services
WHERE log_id = '{{ log_id }}' -- required
;

INSERT examples​

Creates a new group-level logging service within a specified group in your Fivetran account.

INSERT INTO fivetran.external_logging.log_services (
group_id,
service,
enabled,
run_setup_tests,
config
)
SELECT
'{{ group_id }}',
'{{ service }}',
{{ enabled }},
{{ run_setup_tests }},
'{{ config }}'
RETURNING
id,
config,
enabled,
service,
setup_tests,
status
;

UPDATE examples​

Updates information for an existing group-level logging service within your Fivetran account.

UPDATE fivetran.external_logging.log_services
SET
enabled = {{ enabled }},
config = '{{ config }}',
run_setup_tests = {{ run_setup_tests }}
WHERE
log_id = '{{ log_id }}' --required
RETURNING
id,
config,
enabled,
service,
setup_tests,
status;

DELETE examples​

Deletes a group-level logging service from your Fivetran account.

DELETE FROM fivetran.external_logging.log_services
WHERE log_id = '{{ log_id }}' --required
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Runs the setup tests for an existing group-level logging service within your Fivetran account.

EXEC fivetran.external_logging.log_services.run_setup_tests
@log_id='{{ log_id }}' --required
;