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

Workspace Purge - Purge

通过一组用户定义的筛选器清除 Log Analytics 工作区中的数据。

为了管理系统资源,清除请求被限制为每小时 50 个请求。 应通过发送一个命令(其谓词包括需要清除的所有用户标识)来批处理清除请求的执行。 使用 in 运算符指定多个标识。 应在使用清除请求之前运行查询,以验证结果是否预期。 Log Analytics 仅支持符合 GDPR 所需的清除作。 Log Analytics 产品团队保留拒绝出于 GDPR 合规性目的的清除作请求的权利。 如果发生争议,请创建支持票证

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/purge?api-version=2025-02-01

URI 参数

名称 必需 类型 说明
resourceGroupName
path True

string

minLength: 1
maxLength: 90

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

subscriptionId
path True

string

minLength: 1

目标订阅的 ID。

workspaceName
path True

string

minLength: 4
maxLength: 63
pattern: ^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$

工作区的名称。

api-version
query True

string

minLength: 1

用于此作的 API 版本。

请求正文

名称 必需 类型 说明
filters True

WorkspacePurgeBodyFilters[]

要运行这些列和筛选器(查询)集以清除生成的数据。

table True

string

要从中清除数据的表。

响应

名称 类型 说明
202 Accepted

WorkspacePurgeResponse

接受清除 Log Analytics 工作区的请求。

标头

x-ms-status-location: string

安全性

azure_auth

Azure Active Directory OAuth2 Flow

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

作用域

名称 说明
user_impersonation 模拟用户帐户

示例

WorkspacePurge
WorkspacePurgeResourceId

WorkspacePurge

示例请求

POST https://management.azure.com/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/OIAutoRest5123/providers/Microsoft.OperationalInsights/workspaces/aztest5048/purge?api-version=2025-02-01

{
  "table": "Heartbeat",
  "filters": [
    {
      "column": "TimeGenerated",
      "operator": ">",
      "value": "2017-09-01T00:00:00"
    }
  ]
}

示例响应

x-ms-status-location: https://management.azure.com/subscriptions/b96161de-b34a-480f-7343-59b099299283/resourceGroups/example/providers/microsoft.operationalinsights/workspaces/test/operations/purge-970318e7-b859-4edb-8903-83b1b54d0b74?api-version=2025-02-01
{
  "operationId": "7d7cf277-9113-4ab3-8359-d0364b74d01d"
}

WorkspacePurgeResourceId

示例请求

POST https://management.azure.com/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/OIAutoRest5123/providers/Microsoft.OperationalInsights/workspaces/aztest5048/purge?api-version=2025-02-01

{
  "table": "Heartbeat",
  "filters": [
    {
      "column": "_ResourceId",
      "operator": "==",
      "value": "/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/SomeResourceGroup/providers/microsoft.insights/components/AppInsightResource"
    }
  ]
}

示例响应

x-ms-status-location: https://management.azure.com/subscriptions/b96161de-b34a-480f-7343-59b099299283/resourceGroups/example/providers/microsoft.operationalinsights/workspaces/test/operations/purge-970318e7-b859-4edb-8903-83b1b54d0b74?api-version=2025-02-01
{
  "operationId": "7d7cf277-9113-4ab3-8359-d0364b74d01d"
}

定义

名称 说明
WorkspacePurgeBody

描述 App Insights 工作区的清除请求的正文

WorkspacePurgeBodyFilters

用户定义的筛选器用于返回将从表中清除的数据。

WorkspacePurgeResponse

包含特定清除作的 operationId 的响应。

WorkspacePurgeBody

描述 App Insights 工作区的清除请求的正文

名称 类型 说明
filters

WorkspacePurgeBodyFilters[]

要运行这些列和筛选器(查询)集以清除生成的数据。

table

string

要从中清除数据的表。

WorkspacePurgeBodyFilters

用户定义的筛选器用于返回将从表中清除的数据。

名称 类型 说明
column

string

要对其运行给定查询的表的列

key

string

筛选自定义维度时,此键将用作自定义维度的名称。

operator

string

要对提供的列和值进行评估的查询运算符。 支持的运算符为 ==、=~、in、in~、>、>=、<、<=、between 和 KQL 查询中的行为相同。

value

要重写的运算符的值。 可以是数字(例如,> 100)、字符串(时间戳 >= '2017-09-01')或值数组。

WorkspacePurgeResponse

包含特定清除作的 operationId 的响应。

名称 类型 说明
operationId

string

查询特定清除作的状态时要使用的 ID。