Log Analytics çalışma alanında bulunan verileri kullanıcı tanımlı bir filtre kümesiyle temizler.
Sistem kaynaklarını yönetmek için temizleme istekleri saatte 50 istekte kısıtlanıyor. Koşulu temizleme gerektiren tüm kullanıcı kimliklerini içeren tek bir komut göndererek temizleme isteklerinin yürütülmesini toplu olarak gerçekleştirmeniz gerekir. Birden çok kimlik belirtmek için in işlecini kullanın. Sonuçların beklendiğini doğrulamak üzere temizleme isteği için kullanmadan önce sorguyu çalıştırmanız gerekir.
Log Analytics yalnızca GDPR ile uyumluluk için gereken temizleme işlemlerini destekler. Log Analytics ürün ekibi, GDPR uyumluluğu amacıyla olmayan temizleme işlemlerine yönelik istekleri reddetme hakkını saklıdır. Bir anlaşmazlık durumunda lütfen bir destek bileti oluşturun
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/purge?api-version=2020-08-01
URI Parametreleri
Name |
İçinde |
Gerekli |
Tür |
Description |
resourceGroupName
|
path |
True
|
string
|
Kaynak grubunun adı. Ad büyük/küçük harfe duyarlı değildir.
|
subscriptionId
|
path |
True
|
string
|
Hedef aboneliğin kimliği.
|
workspaceName
|
path |
True
|
string
|
Çalışma alanının adı.
Regex pattern: ^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$
|
api-version
|
query |
True
|
string
|
Bu işlem için kullanılacak API sürümü.
|
İstek Gövdesi
Name |
Gerekli |
Tür |
Description |
filters
|
True
|
WorkspacePurgeBodyFilters[]
|
Elde edilen verileri temizlemek için bunların üzerinde çalıştırılacak sütun ve filtre (sorgular) kümesi.
|
table
|
True
|
string
|
Verilerin temizlendiği tablo.
|
Yanıtlar
Name |
Tür |
Description |
202 Accepted
|
WorkspacePurgeResponse
|
Log Analytics çalışma alanını temizleme isteği kabul edildi.
Headers
x-ms-status-location: string
|
Güvenlik
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Description |
user_impersonation
|
kullanıcı hesabınızın kimliğine bürünme
|
Örnekler
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"
}
Tanımlar
WorkspacePurgeBody
App Insights Çalışma Alanı için temizleme isteğinin gövdesini açıklar
Name |
Tür |
Description |
filters
|
WorkspacePurgeBodyFilters[]
|
Elde edilen verileri temizlemek için bunların üzerinde çalıştırılacak sütun ve filtre (sorgular) kümesi.
|
table
|
string
|
Verilerin temizlendiği tablo.
|
WorkspacePurgeBodyFilters
Tablodan temizlenecek verileri döndürmek için kullanıcı tanımlı filtreler.
Name |
Tür |
Description |
column
|
string
|
Verilen sorgunun üzerinde çalışması gereken tablonun sütunu
|
key
|
string
|
Özel boyutlar üzerinde filtreleme yaparken, bu anahtar özel boyutun adı olarak kullanılır.
|
operator
|
string
|
Sağlanan sütun ve değerler üzerinde değerlendirilecek bir sorgu işleci. Desteklenen işleçler ==, =~, in, in~, >, >=, <, <=, between ve bir KQL sorgusundakiyle aynı davranışa sahiptir.
|
value
|
|
işlecin üzerinde çalışması için değer. Bu bir sayı (örneğin, > 100), dize (zaman damgası >= '2017-09-01') veya değer dizisi olabilir.
|
WorkspacePurgeResponse
Belirli bir temizleme eylemi için operationId içeren yanıt.
Name |
Tür |
Description |
operationId
|
string
|
Belirli bir temizleme işleminin durumunu sorgularken kullanılacak kimlik.
|