你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Saved Searches - Get

获取给定工作区的指定保存搜索。

GET https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}?api-version=2020-08-01

URI 参数

名称 必需 类型 说明
resourceGroupName
path True

string

资源组的名称。 此名称不区分大小写。

savedSearchId
path True

string

保存的搜索的 ID。

subscriptionId
path True

string

目标订阅的 ID。

workspaceName
path True

string

工作区的名称。

Regex pattern: ^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$

api-version
query True

string

要用于此操作的 API 版本。

响应

名称 类型 说明
200 OK

SavedSearch

确定响应定义。

安全性

azure_auth

Azure Active Directory OAuth2 流

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

名称 说明
user_impersonation 模拟用户帐户

示例

SavedSearchesGet

Sample Request

GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/TestRG/providers/Microsoft.OperationalInsights/workspaces/TestWS/savedSearches/00000000-0000-0000-0000-00000000000?api-version=2020-08-01

Sample Response

{
  "id": "subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/mms-eus/providers/Microsoft.OperationalInsights/workspaces/AtlantisDemo/savedSearches/test-new-saved-search-id-2015",
  "etag": "W/\"datetime'2017-10-02T23%3A15%3A41.0709875Z'\"",
  "properties": {
    "category": " Saved Search Test Category",
    "displayName": "Create or Update Saved Search Test",
    "functionAlias": "heartbeat_func",
    "functionParameters": "a:int=1",
    "query": "* | measure Count() by Computer | take a",
    "version": 1
  }
}

定义

名称 说明
SavedSearch

保存的搜索结果的值对象。

Tag

已保存搜索的标记。

SavedSearch

保存的搜索结果的值对象。

名称 类型 说明
etag

string

保存的搜索的 ETag。 若要替代现有的已保存搜索,请使用“*”或指定当前 Etag

id

string

资源的完全限定的资源 ID。 例如 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name

string

资源的名称

properties.category

string

保存的搜索的类别。 这有助于用户更快地查找已保存的搜索。

properties.displayName

string

保存的搜索显示名称。

properties.functionAlias

string

如果查询充当函数,则为函数别名。

properties.functionParameters

string

如果查询充当函数,则为可选的函数参数。 值应采用以下格式:“param-name1:type1 = default_value1, param-name2:type2 = default_value2”。 有关更多示例和正确的语法, https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions请参阅 。

properties.query

string

保存的搜索的查询表达式。

properties.tags

Tag[]

附加到已保存搜索的标记。

properties.version

integer

查询语言的版本号。 当前版本为 2,为默认值。

type

string

资源类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts”

Tag

已保存搜索的标记。

名称 类型 说明
name

string

标记名称。

value

string

标记值。