Skip to main content

metrics_searches_v2

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

Overview​

Namemetrics_searches_v2
TypeResource
Idsumologic.metrics_searches.metrics_searches_v2

Fields​

The following fields are returned by SELECT queries:

Metrics search page that was requested.

NameDatatypeDescription
idstringUnique identifier for the metrics search page. (example: B23OjNs5ZCyn5VdMwOBoLo3PjgRnJSAlNTKEDAcpuDG2CIgRe9KFXMofm2H2)
folder_idstringThe identifier of the folder to save the metrics search in. By default it is saved in your personal folder. (example: 000000000C1C17C6) (wire: folderId)
descriptionstringDescription of the metrics search page.
queriesarrayQueries of the metrics search page.
time_rangeobject (wire: timeRange)
titlestringTitle of the metrics search page. (pattern: <code>^\s*\S.*$</code>, x-pattern-message: must contain at least 1 non-whitespace character)
visual_settingsstringVisual settings of the metrics search page. (wire: visualSettings)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectid, regionGet a metrics search page by the given identifier.
listselectregionlimit, token, modeList all metrics search pages under the Personal folder created by the user or under folders viewable by user.
createinsertregion, queries, time_range, titleCreates a new metrics search page.
updateupdateid, region, queries, time_range, titleUpdate a metrics search page by the given identifier.
deletedeleteid, regionDelete metrics search page by the given 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
idstringUnique identifier of the metrics search page to delete.
regionstringSumo Logic deployment (au, ca, ch, de, eu, fed, in, jp, kr, us1, us2). Resolved from the SUMOLOGIC_ENVIRONMENT environment variable when it is set (x-stackQL-envVar, the same variable the Terraform provider reads); otherwise defaults to us2. A WHERE region = '...' value always takes precedence. (enum: [au, ca, ch, de, eu, fed, in, jp, kr, us1, us2], default: us2, x-stackQL-envVar: SUMOLOGIC_ENVIRONMENT)
limitinteger (int32)Limit the number of metric searches returned in the response. The number of metric searches returned may be less than the limit. (example: 50)
modestringwhether to list all viewable metric searches under the folders
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. (example: GDCiRv4vebF3UWFJQ1kySXBOR3Bzh69GR0RyWm9vCtc)

SELECT examples​

Get a metrics search page by the given identifier.

SELECT
id,
folder_id,
description,
queries,
time_range,
title,
visual_settings
FROM sumologic.metrics_searches.metrics_searches_v2
WHERE id = '{{ id }}' -- required
AND region = '{{ region }}' -- required unless SUMOLOGIC_ENVIRONMENT is set
;

INSERT examples​

Creates a new metrics search page.

INSERT INTO sumologic.metrics_searches.metrics_searches_v2 (
title,
time_range,
description,
queries,
visual_settings,
folder_id,
region
)
SELECT
'{{ title }}' /* required */,
'{{ time_range }}' /* required */,
'{{ description }}',
'{{ queries }}' /* required */,
'{{ visual_settings }}',
'{{ folder_id }}',
'{{ region }}'
RETURNING
id,
folder_id,
description,
queries,
time_range,
title,
visual_settings
;

UPDATE examples​

Update a metrics search page by the given identifier.

UPDATE sumologic.metrics_searches.metrics_searches_v2
SET
title = '{{ title }}',
time_range = '{{ time_range }}',
description = '{{ description }}',
queries = '{{ queries }}',
visual_settings = '{{ visual_settings }}',
folder_id = '{{ folder_id }}'
WHERE
id = '{{ id }}' --required
AND region = '{{ region }}' --required unless SUMOLOGIC_ENVIRONMENT is set
AND queries = '{{ queries }}' --required
AND time_range = '{{ time_range }}' --required
AND title = '{{ title }}' --required
RETURNING
id,
folder_id,
description,
queries,
time_range,
title,
visual_settings;

DELETE examples​

Delete metrics search page by the given identifier.

DELETE FROM sumologic.metrics_searches.metrics_searches_v2
WHERE id = '{{ id }}' --required
AND region = '{{ region }}' --required unless SUMOLOGIC_ENVIRONMENT is set
;