Skip to main content

rules

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

Overview

Namerules
TypeResource
Idsumologic.logs_data_forwarding.rules

Fields

The following fields are returned by SELECT queries:

Data forwarding rule that was requested.

NameDatatypeDescription
idstringThe unique identifier of the data forwarding rule. (example: 1)
bucketobject
createdAtstring (date-time)Creation timestamp in UTC in RFC3339 format. (example: 2018-10-16T09:10:00Z)
createdBystringIdentifier of the user who created the resource. (example: 0000000006743FDD)
destinationIdstringThe data forwarding destination id. (example: 1)
enabledbooleanTrue when the data forwarding rule is enabled.
fileFormatstringSpecify the path prefix to a directory in the S3 bucket and how to format the file name. (example: {index}_{day}_{hour}_{minute}_{second})
formatstringFormat of the payload. (pattern: ^(csv|raw|json)$, example: csv, default: csv, x-pattern-message: should be one of the following: 'csv', 'raw', or 'json')
indexIdstringThe id of the Partition or Scheduled View the rule applies to. (example: 1)
modifiedAtstring (date-time)Last modification timestamp in UTC. (example: 2018-10-16T09:10:00Z)
modifiedBystringIdentifier of the user who last modified the resource. (example: 0000000006743FE8)
payloadSchemastringSchema for the payload. (pattern: ^(default|builtInFields|allFields)$, example: default, default: default, x-pattern-message: should be one of the following: 'default', 'builtInFields', or 'allFields')

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getDataForwardingRuleselectindexId, regionGet the details of an S3 data forwarding rule by its Partition or Scheduled View identifier.
getRulesAndBucketsselectregionlimit, tokenGet a list of all S3 data forwarding rules.
createDataForwardingRuleinsertregion, data__destinationId, data__indexIdCreate a data forwarding rule to send data from a Partition or Scheduled View to an S3 bucket.
deleteDataForwardingRuledeleteindexId, regionDelete an S3 data forwarding rule by its Partition or Scheduled View identifier.
updateDataForwardingRuleexecindexId, regionUpdate 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.

NameDatatypeDescription
indexIdstringThe id of the Partition or Scheduled View with the data forwarding rule to update. (example: 1)
regionstringSumoLogic region (enum: [us2, au, ca, de, eu, fed, in, jp], default: us2)
limitinteger (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.
tokenstringContinuation 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

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
;

INSERT examples

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
;

DELETE examples

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

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 }}"
}'
;