Vyčisí data v pracovním prostoru služby Log Analytics pomocí sady uživatelsky definovaných filtrů.
Aby bylo možné spravovat systémové prostředky, požadavky na vyprázdnění se omezují rychlostí 50 požadavků za hodinu. Spuštění požadavků na vymazání byste měli dávkovat odesláním jednoho příkazu, jehož predikát zahrnuje všechny identity uživatelů, které vyžadují vymazání. K určení více identit použijte operátor in. Před použitím příkazu pro žádost o vymazání byste měli spustit dotaz, abyste ověřili, že jsou výsledky očekávané.
Log Analytics podporuje pouze operace mazání, které jsou nutné pro dodržování předpisů GDPR. Produktový tým Log Analytics si vyhrazuje právo odmítnout žádosti o operace mazání, které nejsou určené pro účely dodržování předpisů GDPR. V případě sporu vytvořte lístek podpory.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/purge?api-version=2020-08-01
Parametry identifikátoru URI
Name |
V |
Vyžadováno |
Typ |
Description |
resourceGroupName
|
path |
True
|
string
|
Název skupiny prostředků. V názvu se rozlišují malá a velká písmena.
|
subscriptionId
|
path |
True
|
string
|
ID cílového předplatného.
|
workspaceName
|
path |
True
|
string
|
Název pracovního prostoru.
Regex pattern: ^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$
|
api-version
|
query |
True
|
string
|
Verze rozhraní API, která se má použít pro tuto operaci.
|
Text požadavku
Name |
Vyžadováno |
Typ |
Description |
filters
|
True
|
WorkspacePurgeBodyFilters[]
|
Sada sloupců a filtrů (dotazů), které se mají spustit, aby se vyprázdnila výsledná data.
|
table
|
True
|
string
|
Tabulka, ze které chcete vyprázdnit data.
|
Odpovědi
Name |
Typ |
Description |
202 Accepted
|
WorkspacePurgeResponse
|
Byla přijata žádost o vymazání pracovního prostoru služby Log Analytics.
Headers
x-ms-status-location: string
|
Zabezpečení
azure_auth
Tok Azure Active Directory OAuth2
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Description |
user_impersonation
|
zosobnění uživatelského účtu
|
Příklady
WorkspacePurge
Sample Request
POST https://management.azure.com/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/OIAutoRest5123/providers/Microsoft.OperationalInsights/workspaces/aztest5048/purge?api-version=2020-08-01
{
"table": "Heartbeat",
"filters": [
{
"column": "TimeGenerated",
"operator": ">",
"value": "2017-09-01T00:00:00"
}
]
}
import com.azure.resourcemanager.loganalytics.models.WorkspacePurgeBody;
import com.azure.resourcemanager.loganalytics.models.WorkspacePurgeBodyFilters;
import java.util.Arrays;
/** Samples for WorkspacePurge Purge. */
public final class Main {
/*
* x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesPurge.json
*/
/**
* Sample code: WorkspacePurge.
*
* @param manager Entry point to LogAnalyticsManager.
*/
public static void workspacePurge(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) {
manager
.workspacePurges()
.purgeWithResponse(
"OIAutoRest5123",
"aztest5048",
new WorkspacePurgeBody()
.withTable("Heartbeat")
.withFilters(
Arrays
.asList(
new WorkspacePurgeBodyFilters()
.withColumn("TimeGenerated")
.withOperator(">")
.withValue("2017-09-01T00:00:00"))),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.loganalytics import LogAnalyticsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-loganalytics
# USAGE
python workspaces_purge.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = LogAnalyticsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-00000000000",
)
response = client.workspace_purge.purge(
resource_group_name="OIAutoRest5123",
workspace_name="aztest5048",
body={
"filters": [{"column": "TimeGenerated", "operator": ">", "value": "2017-09-01T00:00:00"}],
"table": "Heartbeat",
},
)
print(response)
# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesPurge.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armoperationalinsights_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationalinsights/armoperationalinsights"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesPurge.json
func ExampleWorkspacePurgeClient_Purge() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armoperationalinsights.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewWorkspacePurgeClient().Purge(ctx, "OIAutoRest5123", "aztest5048", armoperationalinsights.WorkspacePurgeBody{
Filters: []*armoperationalinsights.WorkspacePurgeBodyFilters{
{
Column: to.Ptr("TimeGenerated"),
Operator: to.Ptr(">"),
Value: "2017-09-01T00:00:00",
}},
Table: to.Ptr("Heartbeat"),
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { OperationalInsightsManagementClient } = require("@azure/arm-operationalinsights");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Purges data in an Log Analytics workspace by a set of user-defined filters.
In order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch the execution of purge requests by sending a single command whose predicate includes all user identities that require purging. Use the in operator to specify multiple identities. You should run the query prior to using for a purge request to verify that the results are expected.
Log Analytics only supports purge operations required for compliance with GDPR. The Log Analytics product team reserves the right to reject requests for purge operations that are not for the purpose of GDPR compliance. In the event of a dispute, please create a support ticket
*
* @summary Purges data in an Log Analytics workspace by a set of user-defined filters.
In order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch the execution of purge requests by sending a single command whose predicate includes all user identities that require purging. Use the in operator to specify multiple identities. You should run the query prior to using for a purge request to verify that the results are expected.
Log Analytics only supports purge operations required for compliance with GDPR. The Log Analytics product team reserves the right to reject requests for purge operations that are not for the purpose of GDPR compliance. In the event of a dispute, please create a support ticket
* x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesPurge.json
*/
async function workspacePurge() {
const subscriptionId =
process.env["OPERATIONALINSIGHTS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-00000000000";
const resourceGroupName = process.env["OPERATIONALINSIGHTS_RESOURCE_GROUP"] || "OIAutoRest5123";
const workspaceName = "aztest5048";
const body = {
filters: [{ column: "TimeGenerated", operator: ">", value: "2017-09-01T00:00:00" }],
table: "Heartbeat",
};
const credential = new DefaultAzureCredential();
const client = new OperationalInsightsManagementClient(credential, subscriptionId);
const result = await client.workspacePurge.purge(resourceGroupName, workspaceName, body);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.OperationalInsights;
using Azure.ResourceManager.OperationalInsights.Models;
using Azure.ResourceManager.Resources;
// Generated from example definition: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesPurge.json
// this example is just showing the usage of "WorkspacePurge_Purge" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this OperationalInsightsWorkspaceResource created on azure
// for more information of creating OperationalInsightsWorkspaceResource, please refer to the document of OperationalInsightsWorkspaceResource
string subscriptionId = "00000000-0000-0000-0000-00000000000";
string resourceGroupName = "OIAutoRest5123";
string workspaceName = "aztest5048";
ResourceIdentifier operationalInsightsWorkspaceResourceId = OperationalInsightsWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName);
OperationalInsightsWorkspaceResource operationalInsightsWorkspace = client.GetOperationalInsightsWorkspaceResource(operationalInsightsWorkspaceResourceId);
// invoke the operation
OperationalInsightsWorkspacePurgeContent content = new OperationalInsightsWorkspacePurgeContent("Heartbeat", new OperationalInsightsWorkspacePurgeFilter[]
{
new OperationalInsightsWorkspacePurgeFilter()
{
Column = "TimeGenerated",
Operator = ">",
Value = BinaryData.FromString("\"2017-09-01T00:00:00\""),
}
});
OperationalInsightsWorkspacePurgeResult result = await operationalInsightsWorkspace.PurgeAsync(content);
Console.WriteLine($"Succeeded: {result}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
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=2020-08-01
{
"operationId": "7d7cf277-9113-4ab3-8359-d0364b74d01d"
}
WorkspacePurgeResourceId
Sample Request
POST https://management.azure.com/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/OIAutoRest5123/providers/Microsoft.OperationalInsights/workspaces/aztest5048/purge?api-version=2020-08-01
{
"table": "Heartbeat",
"filters": [
{
"column": "_ResourceId",
"operator": "==",
"value": "/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/SomeResourceGroup/providers/microsoft.insights/components/AppInsightResource"
}
]
}
import com.azure.resourcemanager.loganalytics.models.WorkspacePurgeBody;
import com.azure.resourcemanager.loganalytics.models.WorkspacePurgeBodyFilters;
import java.util.Arrays;
/** Samples for WorkspacePurge Purge. */
public final class Main {
/*
* x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesPurgeResourceId.json
*/
/**
* Sample code: WorkspacePurgeResourceId.
*
* @param manager Entry point to LogAnalyticsManager.
*/
public static void workspacePurgeResourceId(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) {
manager
.workspacePurges()
.purgeWithResponse(
"OIAutoRest5123",
"aztest5048",
new WorkspacePurgeBody()
.withTable("Heartbeat")
.withFilters(
Arrays
.asList(
new WorkspacePurgeBodyFilters()
.withColumn("_ResourceId")
.withOperator("==")
.withValue(
"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/SomeResourceGroup/providers/microsoft.insights/components/AppInsightResource"))),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.loganalytics import LogAnalyticsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-loganalytics
# USAGE
python workspaces_purge_resource_id.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = LogAnalyticsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-00000000000",
)
response = client.workspace_purge.purge(
resource_group_name="OIAutoRest5123",
workspace_name="aztest5048",
body={
"filters": [
{
"column": "_ResourceId",
"operator": "==",
"value": "/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/SomeResourceGroup/providers/microsoft.insights/components/AppInsightResource",
}
],
"table": "Heartbeat",
},
)
print(response)
# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesPurgeResourceId.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { OperationalInsightsManagementClient } = require("@azure/arm-operationalinsights");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Purges data in an Log Analytics workspace by a set of user-defined filters.
In order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch the execution of purge requests by sending a single command whose predicate includes all user identities that require purging. Use the in operator to specify multiple identities. You should run the query prior to using for a purge request to verify that the results are expected.
Log Analytics only supports purge operations required for compliance with GDPR. The Log Analytics product team reserves the right to reject requests for purge operations that are not for the purpose of GDPR compliance. In the event of a dispute, please create a support ticket
*
* @summary Purges data in an Log Analytics workspace by a set of user-defined filters.
In order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch the execution of purge requests by sending a single command whose predicate includes all user identities that require purging. Use the in operator to specify multiple identities. You should run the query prior to using for a purge request to verify that the results are expected.
Log Analytics only supports purge operations required for compliance with GDPR. The Log Analytics product team reserves the right to reject requests for purge operations that are not for the purpose of GDPR compliance. In the event of a dispute, please create a support ticket
* x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesPurgeResourceId.json
*/
async function workspacePurgeResourceId() {
const subscriptionId =
process.env["OPERATIONALINSIGHTS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-00000000000";
const resourceGroupName = process.env["OPERATIONALINSIGHTS_RESOURCE_GROUP"] || "OIAutoRest5123";
const workspaceName = "aztest5048";
const body = {
filters: [
{
column: "_ResourceId",
operator: "==",
value:
"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/SomeResourceGroup/providers/microsoft.insights/components/AppInsightResource",
},
],
table: "Heartbeat",
};
const credential = new DefaultAzureCredential();
const client = new OperationalInsightsManagementClient(credential, subscriptionId);
const result = await client.workspacePurge.purge(resourceGroupName, workspaceName, body);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.OperationalInsights;
using Azure.ResourceManager.OperationalInsights.Models;
using Azure.ResourceManager.Resources;
// Generated from example definition: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesPurgeResourceId.json
// this example is just showing the usage of "WorkspacePurge_Purge" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this OperationalInsightsWorkspaceResource created on azure
// for more information of creating OperationalInsightsWorkspaceResource, please refer to the document of OperationalInsightsWorkspaceResource
string subscriptionId = "00000000-0000-0000-0000-00000000000";
string resourceGroupName = "OIAutoRest5123";
string workspaceName = "aztest5048";
ResourceIdentifier operationalInsightsWorkspaceResourceId = OperationalInsightsWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName);
OperationalInsightsWorkspaceResource operationalInsightsWorkspace = client.GetOperationalInsightsWorkspaceResource(operationalInsightsWorkspaceResourceId);
// invoke the operation
OperationalInsightsWorkspacePurgeContent content = new OperationalInsightsWorkspacePurgeContent("Heartbeat", new OperationalInsightsWorkspacePurgeFilter[]
{
new OperationalInsightsWorkspacePurgeFilter()
{
Column = "_ResourceId",
Operator = "==",
Value = BinaryData.FromString("\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/SomeResourceGroup/providers/microsoft.insights/components/AppInsightResource\""),
}
});
OperationalInsightsWorkspacePurgeResult result = await operationalInsightsWorkspace.PurgeAsync(content);
Console.WriteLine($"Succeeded: {result}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
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=2020-08-01
{
"operationId": "7d7cf277-9113-4ab3-8359-d0364b74d01d"
}
Definice
WorkspacePurgeBody
Popisuje text žádosti o vymazání pracovního prostoru App Insights.
Name |
Typ |
Description |
filters
|
WorkspacePurgeBodyFilters[]
|
Sada sloupců a filtrů (dotazů), které se mají spustit, aby se vyprázdnila výsledná data.
|
table
|
string
|
Tabulka, ze které chcete vyprázdnit data.
|
WorkspacePurgeBodyFilters
Uživatelem definované filtry vrátí data, která se z tabulky vymažou.
Name |
Typ |
Description |
column
|
string
|
Sloupec tabulky, nad kterou se má daný dotaz spustit
|
key
|
string
|
Při filtrování vlastních dimenzí se tento klíč použije jako název vlastní dimenze.
|
operator
|
string
|
Operátor dotazu, který vyhodnotí zadaný sloupec a hodnoty. Podporované operátory jsou ==, =~, in, in~, >, = >, <, <=, between a mají stejné chování jako v dotazu KQL.
|
value
|
|
hodnota operátoru, který má fungovat. Může to být číslo (např. > 100), řetězec (časové razítko >= '2017-09-01') nebo matice hodnot.
|
WorkspacePurgeResponse
Odpověď obsahující operationId pro konkrétní akci vyprázdnění.
Name |
Typ |
Description |
operationId
|
string
|
ID, které se použije při dotazování na stav konkrétní operace vymazání.
|