rules
Creates, updates, deletes, gets or lists a rules
resource.
Overview
Name | rules |
Type | Resource |
Id | sumologic.logs_data_forwarding.rules |
Fields
The following fields are returned by SELECT
queries:
- getDataForwardingRule
- getRulesAndBuckets
Data forwarding rule that was requested.
Name | Datatype | Description |
---|---|---|
id | string | The unique identifier of the data forwarding rule. (example: 1) |
bucket | object | |
createdAt | string (date-time) | Creation timestamp in UTC in RFC3339 format. (example: 2018-10-16T09:10:00Z) |
createdBy | string | Identifier of the user who created the resource. (example: 0000000006743FDD) |
destinationId | string | The data forwarding destination id. (example: 1) |
enabled | boolean | True when the data forwarding rule is enabled. |
fileFormat | string | Specify the path prefix to a directory in the S3 bucket and how to format the file name. (example: {index}_{day}_{hour}_{minute}_{second}) |
format | string | Format of the payload. (pattern: ^(csv|raw|json)$ , example: csv, default: csv, x-pattern-message: should be one of the following: 'csv', 'raw', or 'json') |
indexId | string | The id of the Partition or Scheduled View the rule applies to. (example: 1) |
modifiedAt | string (date-time) | Last modification timestamp in UTC. (example: 2018-10-16T09:10:00Z) |
modifiedBy | string | Identifier of the user who last modified the resource. (example: 0000000006743FE8) |
payloadSchema | string | Schema for the payload. (pattern: ^(default|builtInFields|allFields)$ , example: default, default: default, x-pattern-message: should be one of the following: 'default', 'builtInFields', or 'allFields') |
List of all S3 data forwarding rules.
Name | Datatype | Description |
---|---|---|
data | array | List of S3 data forwarding rules. |
nextToken | string | Next continuation token. (example: VEZuRU4veXF2UWFCUURYSDNQUzJxWlpRRUsvTlBieXA) |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
getDataForwardingRule | select | indexId , region | Get the details of an S3 data forwarding rule by its Partition or Scheduled View identifier. | |
getRulesAndBuckets | select | region | limit , token | Get a list of all S3 data forwarding rules. |
createDataForwardingRule | insert | region , data__destinationId , data__indexId | Create a data forwarding rule to send data from a Partition or Scheduled View to an S3 bucket. | |
deleteDataForwardingRule | delete | indexId , region | Delete an S3 data forwarding rule by its Partition or Scheduled View identifier. | |
updateDataForwardingRule | exec | indexId , region | Update an S3 data forwarding rule by its Partition or Scheduled View identifier. |
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 |
---|---|---|
indexId | string | The id of the Partition or Scheduled View with the data forwarding rule to update. (example: 1) |
region | string | SumoLogic region (enum: [us2, au, ca, de, eu, fed, in, jp], default: us2) |
limit | integer (int32) | Limit the number of data forwarding rules returned in the response. The number of data forwarding rules returned may be less than the limit . |
token | string | Continuation token to get the next page of results. A page object with the next continuation token is returned in the response body. Subsequent GET requests should specify the continuation token to get the next page of results. token is set to null when no more pages are left. |
SELECT
examples
- getDataForwardingRule
- getRulesAndBuckets
Get the details of an S3 data forwarding rule by its Partition or Scheduled View identifier.
SELECT
id,
bucket,
createdAt,
createdBy,
destinationId,
enabled,
fileFormat,
format,
indexId,
modifiedAt,
modifiedBy,
payloadSchema
FROM sumologic.logs_data_forwarding.rules
WHERE indexId = '{{ indexId }}' -- required
AND region = '{{ region }}' -- required
;
Get a list of all S3 data forwarding rules.
SELECT
data,
nextToken
FROM sumologic.logs_data_forwarding.rules
WHERE region = '{{ region }}' -- required
AND limit = '{{ limit }}'
AND token = '{{ token }}'
;
INSERT
examples
- createDataForwardingRule
- Manifest
Create a data forwarding rule to send data from a Partition or Scheduled View to an S3 bucket.
INSERT INTO sumologic.logs_data_forwarding.rules (
data__indexId,
data__destinationId,
data__enabled,
data__fileFormat,
data__payloadSchema,
data__format,
region
)
SELECT
'{{ indexId }}' /* required */,
'{{ destinationId }}' /* required */,
{{ enabled }},
'{{ fileFormat }}',
'{{ payloadSchema }}',
'{{ format }}',
'{{ region }}'
RETURNING
id,
createdAt,
createdBy,
destinationId,
enabled,
fileFormat,
format,
indexId,
modifiedAt,
modifiedBy,
payloadSchema
;
# Description fields are for documentation purposes
- name: rules
props:
- name: region
value: string
description: Required parameter for the rules resource.
- name: indexId
value: string
description: |
The `id` of the Partition or Scheduled View the rule applies to.
- name: destinationId
value: string
description: |
The data forwarding destination id.
- name: enabled
value: boolean
description: |
True when the data forwarding rule is enabled.
- name: fileFormat
value: string
description: |
Specify the path prefix to a directory in the S3 bucket and how to format the file name.
- name: payloadSchema
value: string
description: |
Schema for the payload.
default: default
- name: format
value: string
description: |
Format of the payload.
default: csv
DELETE
examples
- deleteDataForwardingRule
Delete an S3 data forwarding rule by its Partition or Scheduled View identifier.
DELETE FROM sumologic.logs_data_forwarding.rules
WHERE indexId = '{{ indexId }}' --required
AND region = '{{ region }}' --required
;
Lifecycle Methods
- updateDataForwardingRule
Update an S3 data forwarding rule by its Partition or Scheduled View identifier.
EXEC sumologic.logs_data_forwarding.rules.updateDataForwardingRule
@indexId='{{ indexId }}' --required,
@region='{{ region }}' --required
@@json=
'{
"destinationId": "{{ destinationId }}",
"enabled": {{ enabled }},
"fileFormat": "{{ fileFormat }}",
"payloadSchema": "{{ payloadSchema }}",
"format": "{{ format }}"
}'
;