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

Saved Searches - List By Workspace

获取给定 Log Analytics 工作区的已保存搜索

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

URI 参数

名称 必需 类型 说明
resourceGroupName
path True

string

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

subscriptionId
path True

string

目标订阅的 ID。

workspaceName
path True

string

工作区的名称。

正则表达式模式: ^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$

api-version
query True

string

要用于此操作的 API 版本。

响应

名称 类型 说明
200 OK

SavedSearchesListResult

返回给定 Log Analytics 工作区的已保存搜索列表。

安全性

azure_auth

Azure Active Directory OAuth2 流

类型: oauth2
流向: implicit
授权 URL: https://login.microsoftonline.com/common/oauth2/authorize

作用域

名称 说明
user_impersonation 模拟用户帐户

示例

SavedSearchesList

示例请求

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

示例响应

[
  {
    "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",
      "Query": "* | measure Count() by Computer",
      "Tags": [
        {
          "Name": "Group",
          "Value": "Computer"
        }
      ],
      "Version": 1
    }
  }
]

定义

名称 说明
SavedSearch

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

SavedSearchesListResult

保存的搜索列表操作响应。

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”

SavedSearchesListResult

保存的搜索列表操作响应。

名称 类型 说明
value

SavedSearch[]

结果值的数组。

Tag

已保存搜索的标记。

名称 类型 说明
name

string

标记名称。

value

string

标记值。