Log Analytics ワークスペースでは、テーブルによってデータ ソースからのログ データが整理されます。 テーブルのプロパティを構成して、データ モデル、データ アクセス、コストを管理します。 テーブルの種類、列のデータ型、およびテーブル スキーマの概要については、Tables in Azure Monitor Logs を参照してください。
Azure portal でテーブルのプロパティを表示および設定するには:
Log Analytics ワークスペースから [テーブル] を選択します。
[テーブル] 画面には、Log Analytics ワークスペース内のすべてのテーブルのテーブル構成情報が表示されます。
テーブルの右側にある省略記号 (...) を選択して、テーブル管理メニューを開きます。
使用できるテーブル管理オプションは、テーブルの種類によって異なります。
[Manage table] (テーブルの管理) を選択して、テーブルのプロパティを編集します。
[スキーマの編集] を選択して、テーブル スキーマを表示および編集します。 テーブル スキーマ内の列に対して guid 型を使用できる場合でも、GUID 値は文字列として格納およびクエリされます。 詳細については、「Azure Monitor ログのColumn データ型を参照してください。
テーブルのプロパティを管理するには、ログ管理 API の Tables 操作を呼び出します。
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 (読み取り専用)。 |
API を呼び出してテーブル スキーマを表示する方法の例を次に示します。
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"
}
テーブル スキーマ内の列に対して guid 型が表示されている場合でも、GUID 値は格納され、文字列としてクエリされます。 詳細については、「Azure Monitor ログのColumn データ型を参照してください。
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"
}
テーブル スキーマ内の列に対して guid 型を使用できる場合でも、GUID 値は文字列として格納およびクエリされます。 詳細については、「Azure Monitor ログのColumn データ型を参照してください。
テーブルのプロパティを設定するには、 Update-AzOperationalInsightsTable コマンドレットを使用します。