Paket tabel Tambahan memungkinkan Anda menyerap dan menyimpan data di ruang kerja Analitik Log dengan biaya rendah.
Berikut adalah video yang menjelaskan beberapa kegunaan dan manfaat dari rencana tabel Tambahan:
Log Azure Monitor saat ini mendukung rencana tabel Tambahan (Auxiliary) pada tabel kustom berbasis aturan pengumpulan data (DCR) tempat Anda mengirim data yang Anda kumpulkan menggunakan Agen Azure Monitor atau API Ingesti Log.
Artikel ini menjelaskan cara membuat tabel kustom baru dengan paket Tambahan di ruang kerja Analitik Log Anda dan menyiapkan aturan pengumpulan data yang mengirim data ke tabel ini. Untuk informasi selengkapnya tentang konsep paket Tambahan, lihat Paket tabel Log Azure Monitor.
Prasyarat
Untuk membuat tabel kustom dan mengumpulkan data log, Anda memerlukan:
- Ruang kerja Analitik Log tempat Anda memiliki setidaknya hak kontributor.
-
Titik akhir pengumpulan data (DCE).
- Menyiapkan tabel dengan rencana Tambahan hanya berlaku untuk tabel baru. Setelah Anda membuat tabel dengan rencana Tambahan, Anda tidak dapat mengubah rencana tabel.
Nota
Log tambahan umumnya tersedia (GA) untuk semua wilayah cloud publik kecuali Qatar Central, dan tidak tersedia untuk Azure Government atau Azure China.
Membuat tabel kustom dengan paket Tambahan
Untuk membuat tabel kustom dengan paket Tambahan di portal Microsoft Azure:
Dari menu ruang kerja Analitik Log , pilih Tabel.
Pilih Buat.
Pada tab Dasar , tentukan nama dan, secara opsional, deskripsi untuk tabel. Portal secara otomatis menambahkan akhiran _CL ke nama tabel.
Di bawah Rencana tabel, pilih Auxiliary / Lake.
Pilih Berikutnya dan selesaikan langkah-langkah yang tersisa untuk mengonfigurasi skema dan pengumpulan data. Untuk instruksi mendetail tentang langkah-langkah yang tersisa, lihat Menambahkan atau menghapus tabel dan kolom di Log Azure Monitor.
Nota
Sampel ini mencantumkan semua jenis data kolom yang didukung.
Nota
Perintah Azure CLI khusus saat ini tidak tersedia untuk operasi ini. Contoh berikut memanggil REST API Azure Resource Manager yang mendasar secara langsung dengan menggunakan az rest.
subscriptionId="aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e"
resourceGroupName="myResourceGroup"
workspaceName="myWorkspace"
tableName_CL="myTable_CL"
apiVersion="2025-07-01"
providers="Microsoft.OperationalInsights/workspaces/$workspaceName/tables/$tableName_CL"
resourceId="/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/$providers"
payloadFile="./my-table.json"
az account set --subscription $subscriptionId
az rest \
--method put \
--uri "$resourceId?api-version=$apiVersion" \
--body @"$payloadFile"
Perluas untuk melihat file my-table.json.
{
"properties": {
"schema": {
"name": "myTable_CL",
"columns": [
{
"name": "TimeGenerated",
"type": "dateTime"
},
{
"name": "StringProperty",
"type": "string"
},
{
"name": "IntProperty",
"type": "int"
},
{
"name": "LongProperty",
"type": "long"
},
{
"name": "RealProperty",
"type": "real"
},
{
"name": "BooleanProperty",
"type": "boolean"
},
{
"name": "GuidProperty",
"type": "guid"
},
{
"name": "DateTimeProperty",
"type": "dateTime"
}
]
},
"totalRetentionInDays": 365,
"plan": "Auxiliary"
}
}
Nota
Cmdlet Azure PowerShell khusus saat ini tidak tersedia untuk operasi ini. Contoh berikut memanggil REST API Azure Resource Manager yang mendasar secara langsung dengan menggunakan Invoke-AzRestMethod.
$subscriptionId = "aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e"
$resourceGroupName = "myResourceGroup"
$workspaceName = "myWorkspace"
$tableName_CL = "myTable_CL"
$apiVersion = "2025-07-01"
$providers = "Microsoft.OperationalInsights/workspaces/$workspaceName/tables/$tableName_CL"
$resourceId = "/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/$providers"
$payloadFile = "./my-table.json"
Set-AzContext -Subscription $subscriptionId
$restParams = @{
Method = "PUT"
Path = "$resourceId?api-version=$apiVersion"
Payload = Get-Content -Raw -Path $payloadFile
}
Invoke-AzRestMethod @restParams
Perluas untuk melihat file my-table.json.
{
"properties": {
"schema": {
"name": "myTable_CL",
"columns": [
{
"name": "TimeGenerated",
"type": "dateTime"
},
{
"name": "StringProperty",
"type": "string"
},
{
"name": "IntProperty",
"type": "int"
},
{
"name": "LongProperty",
"type": "long"
},
{
"name": "RealProperty",
"type": "real"
},
{
"name": "BooleanProperty",
"type": "boolean"
},
{
"name": "GuidProperty",
"type": "guid"
},
{
"name": "DateTimeProperty",
"type": "dateTime"
}
]
},
"totalRetentionInDays": 365,
"plan": "Auxiliary"
}
}
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName_CL}?api-version={apiVersion}
Authorization: Bearer {accessToken}
Content-Type: application/json
{
"properties": {
"schema": {
"name": "{tableName_CL}",
"columns": [
{"name": "TimeGenerated",
"type": "dateTime"},
{"name": "StringProperty",
"type": "string"},
{"name": "IntProperty",
"type": "int"},
{"name": "LongProperty",
"type": "long"},
{"name": "RealProperty",
"type": "real"},
{"name": "BooleanProperty",
"type": "boolean"},
{"name": "GuidProperty",
"type": "guid"},
{"name": "DateTimeProperty",
"type": "dateTime"}
]
},
"totalRetentionInDays": 365,
"plan": "Auxiliary"
}
}
Nota
- Kolom
TimeGenerated hanya mendukung format ISO 8601 dengan 6 tempat desimal untuk presisi (mikrodetik). Untuk informasi selengkapnya, lihat format tanggalwaktu ISO 8601 yang didukung.
- Tabel dengan paket Tambahan tidak mendukung kolom dengan data dinamis.
Contoh Bicep berikut menggunakan tipe sumber daya Microsoft.OperationalInsights workspaces/tables.
param workspaceName string = 'myWorkspace'
param tableName_CL string = 'myTable_CL'
resource workspace 'Microsoft.OperationalInsights/workspaces@2025-07-01' existing = {
name: workspaceName
}
resource table 'Microsoft.OperationalInsights/workspaces/tables@2025-07-01' = {
parent: workspace
name: tableName_CL
properties: {
schema: {
name: tableName_CL
columns: [
{
name: 'TimeGenerated'
type: 'dateTime'
}
{
name: 'StringProperty'
type: 'string'
}
{
name: 'IntProperty'
type: 'int'
}
{
name: 'LongProperty'
type: 'long'
}
{
name: 'RealProperty'
type: 'real'
}
{
name: 'BooleanProperty'
type: 'boolean'
}
{
name: 'GuidProperty'
type: 'guid'
}
{
name: 'DateTimeProperty'
type: 'dateTime'
}
]
}
totalRetentionInDays: 365
plan: 'Auxiliary'
}
}
Contoh ARM (JSON) berikut menggunakan jenis resource Microsoft.OperationalInsights workspaces/tables.
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"workspaceName": {
"type": "string",
"defaultValue": "myWorkspace"
},
"tableName_CL": {
"type": "string",
"defaultValue": "myTable_CL"
}
},
"resources": [
{
"type": "Microsoft.OperationalInsights/workspaces/tables",
"apiVersion": "2025-07-01",
"name": "[format('{0}/{1}', parameters('workspaceName'), parameters('tableName_CL'))]",
"properties": {
"schema": {
"name": "[parameters('tableName_CL')]",
"columns": [
{
"name": "TimeGenerated",
"type": "dateTime"
},
{
"name": "StringProperty",
"type": "string"
},
{
"name": "IntProperty",
"type": "int"
},
{
"name": "LongProperty",
"type": "long"
},
{
"name": "RealProperty",
"type": "real"
},
{
"name": "BooleanProperty",
"type": "boolean"
},
{
"name": "GuidProperty",
"type": "guid"
},
{
"name": "DateTimeProperty",
"type": "dateTime"
}
]
},
"totalRetentionInDays": 365,
"plan": "Auxiliary"
}
}
]
}
| Variabel |
Contoh nilai |
Kegunaan |
| host |
management.azure.com |
Titik akhir ARM implisit |
| subscriptionId |
aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e |
Masukan pengguna |
| resourceGroupName |
myResourceGroup |
Masukan pengguna |
| namaRuangKerja |
myWorkspace |
Masukan pengguna |
| tableName_CL |
myTable_CL |
Masukan pengguna |
| apiVersion |
2025-07-01 |
Referensi |
Mengirim data ke tabel dengan Rencana Tambahan
Ada beberapa cara untuk memasukkan data ke dalam tabel kustom dengan paket Auxiliary:
- Agen Pemantau Azure (AMA)
- API pengolahan log
- Transformasi ruang kerja
Menggunakan AMA
Jika Anda menggunakan metode ini, tabel kustom Anda hanya boleh memiliki dua kolom - TimeGenerated (jenis datetime) dan RawData (dari jenis string). Aturan pengumpulan data mengirimkan keseluruhan setiap entri log yang Anda kumpulkan ke RawData kolom, dan Log Azure Monitor secara otomatis mengisi TimeGenerated kolom dengan waktu log diserap.
Untuk informasi selengkapnya tentang cara menggunakan AMA, lihat artikel berikut ini:
Gunakan API pengumpulan log
Metode ini dengan cermat mengikuti langkah-langkah yang dijelaskan dalam Tutorial: Mengirim data ke Azure Monitor menggunakan API penyerapan log.
Buat tabel kustom dengan rencana tambahan seperti yang dijelaskan dalam artikel ini.
Buat aplikasi Microsoft Entra.
Membuat aturan pengumpulan data. Berikut adalah contoh templat ARM untuk kind: Direct. Jenis DCR ini tidak memerlukan DCE karena menyertakan logsIngestion titik akhir.
-
myWorkspace adalah nama ruang kerja Analitik Log Anda.
-
myTable_CL adalah nama tabel Anda.
-
columns menyertakan kolom yang sama dengan yang Anda tetapkan dalam pembuatan tabel.
Contoh Azure CLI berikut menggunakan perintah az monitor data-collection rule create.
subscriptionId="aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e"
resourceGroupName="myResourceGroup"
dataCollectionRuleName="myDataCollectionRule"
ruleFile="./my-dcr.json"
az account set --subscription "$subscriptionId"
az extension add --name monitor-control-service
az monitor data-collection rule create \
--resource-group "$resourceGroupName" \
--name "$dataCollectionRuleName" \
--rule-file "$ruleFile"
Nota
perintah Azure CLI menggunakan titik akhir Azure Resource Manager dari konteks CLI saat ini, jadi management.azure.com tidak perlu ditentukan dalam sintaks perintah.
Perluas untuk melihat file my-dcr.json.
{
"location": "eastus",
"kind": "Direct",
"properties": {
"streamDeclarations": {
"Custom-myTable": {
"columns": [
{
"name": "TimeGenerated",
"type": "dateTime"
},
{
"name": "StringProperty",
"type": "string"
},
{
"name": "IntProperty",
"type": "int"
},
{
"name": "LongProperty",
"type": "long"
},
{
"name": "RealProperty",
"type": "real"
},
{
"name": "BooleanProperty",
"type": "boolean"
},
{
"name": "GuidProperty",
"type": "guid"
},
{
"name": "DateTimeProperty",
"type": "dateTime"
}
]
}
},
"destinations": {
"logAnalytics": [
{
"workspaceResourceId": "/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/myWorkspace",
"name": "myWorkspace"
}
]
},
"dataFlows": [
{
"streams": [
"Custom-myTable"
],
"transformKql": "source",
"destinations": [
"myWorkspace"
],
"outputStream": "Custom-myTable_CL"
}
]
}
}
Contoh PowerShell berikut menggunakan cmdlet New-AzDataCollectionRule .
$subscriptionId = "aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e"
$resourceGroupName = "myResourceGroup"
$dataCollectionRuleName = "myDataCollectionRule"
$jsonFilePath = ".\my-dcr.json"
Select-AzSubscription -SubscriptionId $subscriptionId
$dataCollectionRuleParams = @{
Name = $dataCollectionRuleName
ResourceGroupName = $resourceGroupName
JsonFilePath = $jsonFilePath
}
New-AzDataCollectionRule @dataCollectionRuleParams
Nota
Azure PowerShell cmdlet menggunakan titik akhir Azure Resource Manager dari konteks Az saat ini, jadi management.azure.com tidak perlu ditentukan dalam sintaks cmdlet.
Perluas untuk melihat file my-dcr.json.
{
"location": "eastus",
"kind": "Direct",
"properties": {
"streamDeclarations": {
"Custom-myTable": {
"columns": [
{
"name": "TimeGenerated",
"type": "dateTime"
},
{
"name": "StringProperty",
"type": "string"
},
{
"name": "IntProperty",
"type": "int"
},
{
"name": "LongProperty",
"type": "long"
},
{
"name": "RealProperty",
"type": "real"
},
{
"name": "BooleanProperty",
"type": "boolean"
},
{
"name": "GuidProperty",
"type": "guid"
},
{
"name": "DateTimeProperty",
"type": "dateTime"
}
]
}
},
"destinations": {
"logAnalytics": [
{
"workspaceResourceId": "/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/myWorkspace",
"name": "myWorkspace"
}
]
},
"dataFlows": [
{
"streams": [
"Custom-myTable"
],
"transformKql": "source",
"destinations": [
"myWorkspace"
],
"outputStream": "Custom-myTable_CL"
}
]
}
}
Nota
Panggilan REST berikut menggunakan nilai contoh.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}?api-version={apiVersion}
Authorization: Bearer {accessToken}
Content-Type: application/json
{
"location": "<location>",
"kind": "Direct",
"properties": {
"streamDeclarations": {
"<Custom-tableName>": {
"columns": [
{
"name": "TimeGenerated",
"type": "dateTime"
},
{
"name": "StringProperty",
"type": "string"
},
{
"name": "IntProperty",
"type": "int"
},
{
"name": "LongProperty",
"type": "long"
},
{
"name": "RealProperty",
"type": "real"
},
{
"name": "BooleanProperty",
"type": "boolean"
},
{
"name": "GuidProperty",
"type": "guid"
},
{
"name": "DateTimeProperty",
"type": "dateTime"
}
]
}
},
"destinations": {
"logAnalytics": [
{
"workspaceResourceId": "/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.OperationalInsights/workspaces/<workspaceName>",
"name": "<workspaceName>"
}
]
},
"dataFlows": [
{
"streams": [
"<Custom-tableName>"
],
"transformKql": "source",
"destinations": [
"myWorkspace"
],
"outputStream": "<Custom-tableName_CL>"
}
]
}
}
Contoh Bicep berikut menggunakan tipe sumber daya Microsoft.Insights dataCollectionRules.
@description('Specifies the name of the data collection rule to create.')
param dataCollectionRuleName string = 'myDataCollectionRule'
@description('Specifies the region in which to create the data collection rule. The must be the same region as the destination Log Analytics workspace.')
param location string = 'eastus'
@description('The Azure resource ID of the Log Analytics workspace in which you created a custom table with the Auxiliary plan.')
param workspaceResourceId string = '/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/myWorkspace'
resource dataCollectionRule 'Microsoft.Insights/dataCollectionRules@2025-07-01' = {
name: dataCollectionRuleName
location: location
kind: 'Direct'
properties: {
streamDeclarations: {
'Custom-myTable': {
columns: [
{
name: 'TimeGenerated'
type: 'dateTime'
}
{
name: 'StringProperty'
type: 'string'
}
{
name: 'IntProperty'
type: 'int'
}
{
name: 'LongProperty'
type: 'long'
}
{
name: 'RealProperty'
type: 'real'
}
{
name: 'BooleanProperty'
type: 'boolean'
}
{
name: 'GuidProperty'
type: 'guid'
}
{
name: 'DateTimeProperty'
type: 'dateTime'
}
]
}
}
destinations: {
logAnalytics: [
{
workspaceResourceId: workspaceResourceId
name: 'myWorkspace'
}
]
}
dataFlows: [
{
streams: [
'Custom-myTable'
]
transformKql: 'source'
destinations: [
'myWorkspace'
]
outputStream: 'Custom-myTable_CL'
}
]
}
}
output dataCollectionRuleId string = dataCollectionRule.id
Contoh ARM (JSON) berikut menggunakan Microsoft. Data InsightsCollectionRules jenis sumber daya.
{
"$schema": "https://schema.management.azure.com/schemas/2019-08-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"dataCollectionRuleName": {
"type": "string",
"defaultValue": "myDataCollectionRule",
"metadata": {
"description": "Specifies the name of the data collection rule to create."
}
},
"location": {
"type": "string",
"defaultValue": "eastus",
"metadata": {
"description": "Specifies the region in which to create the data collection rule. The must be the same region as the destination Log Analytics workspace."
}
},
"workspaceResourceId": {
"type": "string",
"defaultValue": "/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/myWorkspace",
"metadata": {
"description": "The Azure resource ID of the Log Analytics workspace in which you created a custom table with the Auxiliary plan."
}
}
},
"resources": [
{
"type": "Microsoft.Insights/dataCollectionRules",
"name": "[parameters('dataCollectionRuleName')]",
"location": "[parameters('location')]",
"apiVersion": "2025-07-01",
"kind": "Direct",
"properties": {
"streamDeclarations": {
"Custom-myTable": {
"columns": [
{
"name": "TimeGenerated",
"type": "dateTime"
},
{
"name": "StringProperty",
"type": "string"
},
{
"name": "IntProperty",
"type": "int"
},
{
"name": "LongProperty",
"type": "long"
},
{
"name": "RealProperty",
"type": "real"
},
{
"name": "BooleanProperty",
"type": "boolean"
},
{
"name": "GuidProperty",
"type": "guid"
},
{
"name": "DateTimeProperty",
"type": "dateTime"
}
]
}
},
"destinations": {
"logAnalytics": [
{
"workspaceResourceId": "[parameters('workspaceResourceId')]",
"name": "myWorkspace"
}
]
},
"dataFlows": [
{
"streams": [
"Custom-myTable"
],
"transformKql": "source",
"destinations": [
"myWorkspace"
],
"outputStream": "Custom-myTable_CL"
}
]
}
}
],
"outputs": {
"dataCollectionRuleId": {
"type": "string",
"value": "[resourceId('Microsoft.Insights/dataCollectionRules', parameters('dataCollectionRuleName'))]"
}
}
}
| Variabel |
Contoh nilai |
Kegunaan |
| host |
management.azure.com |
Titik akhir ARM implisit |
| subscriptionId |
aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e |
Masukan pengguna |
| resourceGroupName |
myResourceGroup |
Masukan pengguna |
| dataCollectionRuleName |
myDataCollectionRule |
Masukan pengguna |
| lokasi |
eastus |
Masukan pengguna |
| Custom-tableName |
Custom-myTable |
Masukan pengguna |
| Kustom-tableName_CL |
Kustom-myTable_CL |
Masukan pengguna |
| apiVersion |
2025-07-01 |
Referensi |
Berikan izin aplikasi Anda untuk menggunakan DCR Anda.
Mengirim data menggunakan kode sampel.
Peringatan
Saat mengambil log ke dalam lapisan Tambahan Azure Monitor, hindari mengirimkan satu payload yang berisi timestamp TimeGenerated yang mencakup lebih dari 30 menit dalam satu panggilan API. Panggilan API ini bisa menyebabkan terjadinya kode kesalahan penerimaan sebagai berikut RecordsTimeRangeIsMoreThan30Minutes. Ini adalah batasan yang diketahui yang dihapus.
Pembatasan ini tidak berlaku untuk log Tambahan yang menggunakan transformasi.
Untuk informasi lebih lanjut, baca artikel berikut:
Konten terkait