Skip to main content

output_graylog_stream_alerts

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

Overview​

Nameoutput_graylog_stream_alerts
TypeResource
Idovh.dbaas_logs.output_graylog_stream_alerts

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
alert_idstring (uuid)Stream alert condition ID (wire: alertId)
backlogintegerBacklog size
condition_typestringAlert condition type (FIELD_CONTENT_VALUE, FIELD_VALUE, MESSAGE_COUNT) (wire: conditionType)
constraint_typestringConstraint type (MAX, MEAN, MIN, STDLABEU, SUM) (wire: constraintType)
fieldstringField name
graceintegerGrace period in minutes
query_filterstringQuery filter (wire: queryFilter)
repeat_notifications_enabledbooleanRepeat notifications (wire: repeatNotificationsEnabled)
thresholdintegerThreshold
threshold_typestringThreshold condition (EQ, GT, GTE, LT, LTE) (wire: thresholdType)
timeintegerTime lapse in minutes
titlestringCondition label
valuestringField value

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectalert_id, service_name, stream_idReturns the stream alert.
listselectservice_name, stream_idx_pagination_modeReturns the stream alerts of the Logs Data Platform service.
createinsertservice_name, stream_id, backlog, grace, titleCreates a stream alert on the Logs Data Platform service.
updateupdatealert_id, service_name, stream_id, backlog, grace, titleUpdates the stream alert.
deletedeletealert_id, service_name, stream_idDeletes the stream alert.

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
alert_idstring (uuid)Alert ID (wire: alertId)
api_hoststringThe OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}})
service_namestringService name (wire: serviceName)
stream_idstring (uuid)Stream ID (wire: streamId)
x_pagination_modestringSent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode)

SELECT examples​

Returns the stream alert.

SELECT
alert_id,
backlog,
condition_type,
constraint_type,
field,
grace,
query_filter,
repeat_notifications_enabled,
threshold,
threshold_type,
time,
title,
value
FROM ovh.dbaas_logs.output_graylog_stream_alerts
WHERE alert_id = '{{ alert_id }}' -- required
AND service_name = '{{ service_name }}' -- required
AND stream_id = '{{ stream_id }}' -- required
;

INSERT examples​

Creates a stream alert on the Logs Data Platform service.

INSERT INTO ovh.dbaas_logs.output_graylog_stream_alerts (
backlog,
condition_type,
constraint_type,
field,
grace,
query_filter,
repeat_notifications_enabled,
threshold,
threshold_type,
time,
title,
value,
service_name,
stream_id
)
SELECT
{{ backlog }} /* required */,
'{{ condition_type }}',
'{{ constraint_type }}',
'{{ field }}',
{{ grace }} /* required */,
'{{ query_filter }}',
{{ repeat_notifications_enabled }},
{{ threshold }},
'{{ threshold_type }}',
{{ time }},
'{{ title }}' /* required */,
'{{ value }}',
'{{ service_name }}',
'{{ stream_id }}'
RETURNING
alias_id,
dashboard_id,
encryption_key_id,
index_id,
input_id,
operation_id,
osd_id,
role_id,
stream_id,
subscription_id,
tenant_id,
token_id,
service_name,
created_at,
state,
updated_at
;

UPDATE examples​

Updates the stream alert.

UPDATE ovh.dbaas_logs.output_graylog_stream_alerts
SET
backlog = {{ backlog }},
condition_type = '{{ condition_type }}',
constraint_type = '{{ constraint_type }}',
field = '{{ field }}',
grace = {{ grace }},
query_filter = '{{ query_filter }}',
repeat_notifications_enabled = {{ repeat_notifications_enabled }},
threshold = {{ threshold }},
threshold_type = '{{ threshold_type }}',
time = {{ time }},
title = '{{ title }}',
value = '{{ value }}'
WHERE
alert_id = '{{ alert_id }}' --required
AND service_name = '{{ service_name }}' --required
AND stream_id = '{{ stream_id }}' --required
AND backlog = '{{ backlog }}' --required
AND grace = '{{ grace }}' --required
AND title = '{{ title }}' --required
RETURNING
alias_id,
dashboard_id,
encryption_key_id,
index_id,
input_id,
operation_id,
osd_id,
role_id,
stream_id,
subscription_id,
tenant_id,
token_id,
service_name,
created_at,
state,
updated_at;

DELETE examples​

Deletes the stream alert.

DELETE FROM ovh.dbaas_logs.output_graylog_stream_alerts
WHERE alert_id = '{{ alert_id }}' --required
AND service_name = '{{ service_name }}' --required
AND stream_id = '{{ stream_id }}' --required
;