output_graylog_stream_alerts
Creates, updates, deletes, gets or lists an output_graylog_stream_alerts resource.
Overview​
| Name | output_graylog_stream_alerts |
| Type | Resource |
| Id | ovh.dbaas_logs.output_graylog_stream_alerts |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
alert_id | string (uuid) | Stream alert condition ID (wire: alertId) |
backlog | integer | Backlog size |
condition_type | string | Alert condition type (FIELD_CONTENT_VALUE, FIELD_VALUE, MESSAGE_COUNT) (wire: conditionType) |
constraint_type | string | Constraint type (MAX, MEAN, MIN, STDLABEU, SUM) (wire: constraintType) |
field | string | Field name |
grace | integer | Grace period in minutes |
query_filter | string | Query filter (wire: queryFilter) |
repeat_notifications_enabled | boolean | Repeat notifications (wire: repeatNotificationsEnabled) |
threshold | integer | Threshold |
threshold_type | string | Threshold condition (EQ, GT, GTE, LT, LTE) (wire: thresholdType) |
time | integer | Time lapse in minutes |
title | string | Condition label |
value | string | Field value |
Alert condition
| Name | Datatype | Description |
|---|---|---|
alert_id | string (uuid) | Stream alert condition ID (wire: alertId) |
backlog | integer | Backlog size |
condition_type | string | Alert condition type (FIELD_CONTENT_VALUE, FIELD_VALUE, MESSAGE_COUNT) (wire: conditionType) |
constraint_type | string | Constraint type (MAX, MEAN, MIN, STDLABEU, SUM) (wire: constraintType) |
field | string | Field name |
grace | integer | Grace period in minutes |
query_filter | string | Query filter (wire: queryFilter) |
repeat_notifications_enabled | boolean | Repeat notifications (wire: repeatNotificationsEnabled) |
threshold | integer | Threshold |
threshold_type | string | Threshold condition (EQ, GT, GTE, LT, LTE) (wire: thresholdType) |
time | integer | Time lapse in minutes |
title | string | Condition label |
value | string | Field value |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | alert_id, service_name, stream_id | Returns the stream alert. | |
list | select | service_name, stream_id | x_pagination_mode | Returns the stream alerts of the Logs Data Platform service. |
create | insert | service_name, stream_id, backlog, grace, title | Creates a stream alert on the Logs Data Platform service. | |
update | update | alert_id, service_name, stream_id, backlog, grace, title | Updates the stream alert. | |
delete | delete | alert_id, service_name, stream_id | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
alert_id | string (uuid) | Alert ID (wire: alertId) |
api_host | string | The 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_name | string | Service name (wire: serviceName) |
stream_id | string (uuid) | Stream ID (wire: streamId) |
x_pagination_mode | string | Sent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode) |
SELECT examples​
- get
- list
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
;
Returns the stream alerts of the Logs Data Platform service.
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 service_name = '{{ service_name }}' -- required
AND stream_id = '{{ stream_id }}' -- required
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: output_graylog_stream_alerts
props:
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the output_graylog_stream_alerts resource.
- name: stream_id
value: "{{ stream_id }}"
description: Required parameter for the output_graylog_stream_alerts resource.
- name: backlog
value: {{ backlog }}
description: |
Backlog
- name: condition_type
value: "{{ condition_type }}"
description: |
Condition type
valid_values: ['FIELD_CONTENT_VALUE', 'FIELD_VALUE', 'MESSAGE_COUNT']
- name: constraint_type
value: "{{ constraint_type }}"
description: |
Constraint type
valid_values: ['MAX', 'MEAN', 'MIN', 'STDLABEU', 'SUM']
- name: field
value: "{{ field }}"
description: |
Field
- name: grace
value: {{ grace }}
description: |
Grace period
- name: query_filter
value: "{{ query_filter }}"
description: |
Query filter
- name: repeat_notifications_enabled
value: {{ repeat_notifications_enabled }}
description: |
Repeat notifications enabled
- name: threshold
value: {{ threshold }}
description: |
Threshold
- name: threshold_type
value: "{{ threshold_type }}"
description: |
Threshold type
valid_values: ['EQ', 'GT', 'GTE', 'LT', 'LTE']
- name: time
value: {{ time }}
description: |
Time
- name: title
value: "{{ title }}"
description: |
Title
- name: value
value: "{{ value }}"
description: |
Value
UPDATE examples​
- update
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​
- delete
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
;