Skip to main content

saved_searches

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

Overview

Namesaved_searches
TypeResource
Idazure.log_analytics.saved_searches

Fields

NameDatatypeDescription
categorytextfield from the properties object
display_nametextfield from the properties object
etagtextThe ETag of the saved search. To override an existing saved search, use "*" or specify the current Etag
function_aliastextfield from the properties object
function_parameterstextfield from the properties object
querytextfield from the properties object
resourceGroupNametextfield from the properties object
savedSearchIdtextfield from the properties object
subscriptionIdtextfield from the properties object
tagstextfield from the properties object
versiontextfield from the properties object
workspaceNametextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTresourceGroupName, savedSearchId, subscriptionId, workspaceNameGets the specified saved search for a given workspace.
list_by_workspaceSELECTresourceGroupName, subscriptionId, workspaceNameGets the saved searches for a given Log Analytics Workspace
create_or_updateINSERTresourceGroupName, savedSearchId, subscriptionId, workspaceName, data__propertiesCreates or updates a saved search for a given workspace.
deleteDELETEresourceGroupName, savedSearchId, subscriptionId, workspaceNameDeletes the specified saved search in a given workspace.

SELECT examples

Gets the saved searches for a given Log Analytics Workspace

SELECT
category,
display_name,
etag,
function_alias,
function_parameters,
query,
resourceGroupName,
savedSearchId,
subscriptionId,
tags,
version,
workspaceName
FROM azure.log_analytics.vw_saved_searches
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND workspaceName = '{{ workspaceName }}';

INSERT example

Use the following StackQL query and manifest file to create a new saved_searches resource.

/*+ create */
INSERT INTO azure.log_analytics.saved_searches (
resourceGroupName,
savedSearchId,
subscriptionId,
workspaceName,
data__properties,
etag,
properties
)
SELECT
'{{ resourceGroupName }}',
'{{ savedSearchId }}',
'{{ subscriptionId }}',
'{{ workspaceName }}',
'{{ data__properties }}',
'{{ etag }}',
'{{ properties }}'
;

DELETE example

Deletes the specified saved_searches resource.

/*+ delete */
DELETE FROM azure.log_analytics.saved_searches
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND savedSearchId = '{{ savedSearchId }}'
AND subscriptionId = '{{ subscriptionId }}'
AND workspaceName = '{{ workspaceName }}';