log_services
Creates, updates, deletes, gets or lists a log_services resource.
Overview
| Name | log_services |
| Type | Resource |
| Id | fivetran.external_logging.log_services |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier for the log service within the Fivetran system. (example: log_id) |
config | object | The 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. |
enabled | boolean | The boolean value specifying whether the log service is enabled. |
service | string | The 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_tests | array | Results of the most recent setup test run. |
status | object | Setup status of the log service. Present when a setup status exists for the log service. |
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier for the log service within the Fivetran system. (example: log_id) |
enabled | boolean | The boolean value specifying whether the log service is enabled. |
service | string | The 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) |
status | object | Setup status of the log service. Present when a setup status exists for the log service. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | log_id | Returns a group-level [logging service](https://fivetran.com/docs/logs/external-logs) object if a valid identifier was provided. | |
list | select | cursor, limit | Returns a list of all accessible [logging services](https://fivetran.com/docs/logs/external-logs) within your Fivetran account. | |
create | insert | Creates a new group-level [logging service](https://fivetran.com/docs/logs/external-logs) within a specified group in your Fivetran account. | ||
update | update | log_id | Updates information for an existing group-level [logging service](https://fivetran.com/docs/logs/external-logs) within your Fivetran account. | |
delete | delete | log_id | Deletes a group-level [logging service](https://fivetran.com/docs/logs/external-logs) from your Fivetran account. | |
run_setup_tests | exec | log_id | Runs 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.
| Name | Datatype | Description |
|---|---|---|
log_id | string | The unique identifier for the log service within the Fivetran system. |
cursor | string | Paging cursor, [read more about pagination](https://fivetran.com/docs/rest-api/pagination) |
limit | integer (int32) | Number of records to fetch per page. Accepts a number in the range 1..1000; the default value is 100. |
SELECT examples
- get
- list
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
;
Returns a list of all accessible logging services within your Fivetran account.
SELECT
id,
enabled,
service,
status
FROM fivetran.external_logging.log_services
WHERE "limit" = '{{ limit }}'
;
INSERT examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: log_services
props:
- name: group_id
value: "{{ group_id }}"
description: |
The unique identifier for the group within the Fivetran system
- name: service
value: "{{ service }}"
description: |
The 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).
- name: enabled
value: {{ enabled }}
description: |
The boolean value specifying whether the log service is enabled.
- name: run_setup_tests
value: {{ run_setup_tests }}
description: |
When `true`, Fivetran runs setup tests immediately after creating or updating the log service and returns the results in the `setup_tests` field of the response. Defaults to `false`.
- name: config
value: "{{ config }}"
description: |
The `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.
UPDATE examples
- update
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
- delete
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.
- run_setup_tests
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
;