若要檢視資料表屬性,請呼叫資料表 - 取得 API:
GET https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}?api-version={api-version}
回應本文
| 名稱 |
類型 |
描述 |
| properties.plan |
字串 |
資料表方案。
Analytics、Basic 或 Auxiliary。 |
| properties.retentionInDays |
整數 |
資料表的互動式保留天數。 針對 Basic 和 Auxiliiary,此值為 30 天。 針對 Analytics,此值介於 4 到 730 天之間。 |
| properties.totalRetentionInDays |
整數 |
資料表的資料保留總計,包括互動式和長期保留。 |
| properties.archiveRetentionInDays |
整數 |
資料表的長期保留期間 (唯讀、計算)。 |
| properties.lastPlanModifiedDate |
字串 |
上次為此資料表設定方案的時間。 如果從未變更預設設定,則為 Null (唯讀)。 |
範例要求
GET https://management.azure.com/subscriptions/ContosoSID/resourcegroups/ContosoRG/providers/Microsoft.OperationalInsights/workspaces/ContosoWorkspace/tables/ContainerLogV2?api-version=2025-02-01
範例回覆
狀態碼:200
{
"properties": {
"retentionInDays": 8,
"totalRetentionInDays": 8,
"archiveRetentionInDays": 0,
"plan": "Basic",
"lastPlanModifiedDate": "2022-01-01T14:34:04.37",
"schema": {...},
"provisioningState": "Succeeded"
},
"id": "subscriptions/ContosoSID/resourcegroups/ContosoRG/providers/Microsoft.OperationalInsights/workspaces/ContosoWorkspace",
"name": "ContainerLogV2"
}
若要設定資料表屬性,請呼叫資料表 - 建立或更新 API。
若要使用 PowerShell 檢視資料表屬性,請執行:
Invoke-AzRestMethod -Path "/subscriptions/ContosoSID/resourcegroups/ContosoRG/providers/microsoft.operationalinsights/workspaces/ContosoWorkspace/tables/Heartbeat?api-version=2025-02-01" -Method GET
範例回覆
{
"properties": {
"totalRetentionInDays": 30,
"archiveRetentionInDays": 0,
"plan": "Analytics",
"retentionInDaysAsDefault": true,
"totalRetentionInDaysAsDefault": true,
"schema": {
"tableSubType": "Any",
"name": "Heartbeat",
"tableType": "Microsoft",
"standardColumns": [
{
"name": "TenantId",
"type": "guid",
"description": "ID of the workspace that stores this record.",
"isDefaultDisplay": true,
"isHidden": true
},
{
"name": "SourceSystem",
"type": "string",
"description": "Type of agent the data was collected from. Possible values are OpsManager (Windows agent) or Linux.",
"isDefaultDisplay": true,
"isHidden": false
},
{
"name": "TimeGenerated",
"type": "datetime",
"description": "Date and time the record was created.",
"isDefaultDisplay": true,
"isHidden": false
},
{
"name": "ComputerPrivateIPs",
"type": "dynamic",
"description": "The list of private IP addresses of the computer.",
"isDefaultDisplay": true,
"isHidden": false
}
],
"solutions": [
"LogManagement"
],
"isTroubleshootingAllowed": false
},
"provisioningState": "Succeeded",
"retentionInDays": 30
},
"id": "/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourceGroups/ContosoRG/providers/Microsoft.OperationalInsights/workspaces/ContosoWorkspace/tables/Heartbeat",
"name": "Heartbeat"
}
使用 Update-AzOperationalInsightsTable Cmdlet 設定資料表屬性。