Set-AzureRmNetworkWatcherConfigFlowLog
Mengonfigurasi pengelogan alur untuk sumber daya target.
Peringatan
Modul AzureRM PowerShell telah resmi tidak digunakan lagi per 29 Februari 2024. Pengguna disarankan untuk bermigrasi dari AzureRM ke modul Az PowerShell untuk memastikan dukungan dan pembaruan yang berkelanjutan.
Meskipun modul AzureRM mungkin masih berfungsi, modul tersebut tidak lagi dipertahankan atau didukung, menempatkan penggunaan berkelanjutan berdasarkan kebijaksanaan dan risiko pengguna. Silakan merujuk ke sumber daya migrasi kami untuk panduan tentang transisi ke modul Az.
Sintaks
Set-AzureRmNetworkWatcherConfigFlowLog
-NetworkWatcher <PSNetworkWatcher>
-TargetResourceId <String>
-EnableFlowLog <Boolean>
-StorageAccountId <String>
[-EnableRetention <Boolean>]
[-RetentionInDays <Int32>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzureRmNetworkWatcherConfigFlowLog
-NetworkWatcher <PSNetworkWatcher>
-TargetResourceId <String>
-EnableFlowLog <Boolean>
-StorageAccountId <String>
[-EnableRetention <Boolean>]
[-RetentionInDays <Int32>]
[-AsJob]
[-EnableTrafficAnalytics]
-Workspace <IOperationalInsightWorkspace>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzureRmNetworkWatcherConfigFlowLog
-NetworkWatcher <PSNetworkWatcher>
-TargetResourceId <String>
-EnableFlowLog <Boolean>
-StorageAccountId <String>
[-EnableRetention <Boolean>]
[-RetentionInDays <Int32>]
[-AsJob]
[-EnableTrafficAnalytics]
-WorkspaceResourceId <String>
-WorkspaceGUID <String>
-WorkspaceLocation <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzureRmNetworkWatcherConfigFlowLog
-NetworkWatcherName <String>
-ResourceGroupName <String>
-TargetResourceId <String>
-EnableFlowLog <Boolean>
-StorageAccountId <String>
[-EnableRetention <Boolean>]
[-RetentionInDays <Int32>]
[-AsJob]
[-EnableTrafficAnalytics]
-Workspace <IOperationalInsightWorkspace>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzureRmNetworkWatcherConfigFlowLog
-NetworkWatcherName <String>
-ResourceGroupName <String>
-TargetResourceId <String>
-EnableFlowLog <Boolean>
-StorageAccountId <String>
[-EnableRetention <Boolean>]
[-RetentionInDays <Int32>]
[-AsJob]
[-EnableTrafficAnalytics]
-WorkspaceResourceId <String>
-WorkspaceGUID <String>
-WorkspaceLocation <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzureRmNetworkWatcherConfigFlowLog
-NetworkWatcherName <String>
-ResourceGroupName <String>
-TargetResourceId <String>
-EnableFlowLog <Boolean>
-StorageAccountId <String>
[-EnableRetention <Boolean>]
[-RetentionInDays <Int32>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzureRmNetworkWatcherConfigFlowLog
-Location <String>
-TargetResourceId <String>
-EnableFlowLog <Boolean>
-StorageAccountId <String>
[-EnableRetention <Boolean>]
[-RetentionInDays <Int32>]
[-AsJob]
[-EnableTrafficAnalytics]
-Workspace <IOperationalInsightWorkspace>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzureRmNetworkWatcherConfigFlowLog
-Location <String>
-TargetResourceId <String>
-EnableFlowLog <Boolean>
-StorageAccountId <String>
[-EnableRetention <Boolean>]
[-RetentionInDays <Int32>]
[-AsJob]
[-EnableTrafficAnalytics]
-WorkspaceResourceId <String>
-WorkspaceGUID <String>
-WorkspaceLocation <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzureRmNetworkWatcherConfigFlowLog
-Location <String>
-TargetResourceId <String>
-EnableFlowLog <Boolean>
-StorageAccountId <String>
[-EnableRetention <Boolean>]
[-RetentionInDays <Int32>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Deskripsi
Set-AzureRmNetworkWatcherConfigFlowLog mengonfigurasi pengelogan alur untuk sumber daya target. Properti yang akan dikonfigurasi meliputi: apakah pengelogan alur diaktifkan atau tidak untuk sumber daya yang disediakan, akun penyimpanan yang dikonfigurasi untuk mengirim log, dan kebijakan penyimpanan untuk log. Saat ini Kelompok Keamanan Jaringan didukung untuk pengelogan alur.
Contoh
Contoh 1: Mengonfigurasi Pengelogan Alur untuk NSG Tertentu
PS C:\> $NW = Get-AzurermNetworkWatcher -ResourceGroupName NetworkWatcherRg -Name NetworkWatcher_westcentralus
PS C:\> $nsg = Get-AzureRmNetworkSecurityGroup -ResourceGroupName NSGRG -Name appNSG
PS C:\> $storageId = "/subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourceGroups/NSGRG/providers/Microsoft.Storage/storageAccounts/contosostorageacct123"
PS C:\> Set-AzureRmNetworkWatcherConfigFlowLog -NetworkWatcher $NW -TargetResourceId $nsg.Id -EnableFlowLog $true -StorageAccountId $storageID
TargetResourceId : /subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourceGroups/NSGRG/providers/Microsoft.Network/networkSecurityGroups/appNSG
StorageId : /subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourceGroups/NSGRG/providers/Microsoft.Storage/storageAccounts/contosostorageacct123
Enabled : True
RetentionPolicy : {
"Days": 0,
"Enabled": false
}
Dalam contoh ini, kami mengonfigurasi status pengelogan alur untuk Grup Keamanan Jaringan. Dalam responsnya, kita melihat NSG yang ditentukan mengaktifkan pengelogan alur, dan tidak ada kumpulan kebijakan penyimpanan.
Contoh 2: Mengonfigurasi Pengelogan Alur dan Analitik Lalu Lintas untuk NSG Tertentu
PS C:\> $NW = Get-AzurermNetworkWatcher -ResourceGroupName NetworkWatcherRg -Name NetworkWatcher_westcentralus
PS C:\> $nsg = Get-AzureRmNetworkSecurityGroup -ResourceGroupName NSGRG -Name appNSG
PS C:\> $storageId = "/subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourceGroups/NSGRG/providers/Microsoft.Storage/storageAccounts/contosostorageacct123"
PS C:\> $workspace = Get-AzureRmOperationalInsightsWorkspace -Name WorkspaceName -ResourceGroupName WorkspaceRg
PS C:\> Set-AzureRmNetworkWatcherConfigFlowLog -NetworkWatcher $NW -TargetResourceId $nsg.Id -EnableFlowLog $true -StorageAccountId $storageID -EnableTrafficAnalytics -Workspace $workspace
TargetResourceId : /subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourceGroups/NSGRG/providers/Microsoft.Network/networkSecurityGroups/appNSG
StorageId : /subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourceGroups/NSGRG/providers/Microsoft.Storage/storageAccounts/contosostorageacct123
Enabled : True
RetentionPolicy : {
"Days": 0,
"Enabled": false
}
FlowAnalyticsConfiguration : {
"networkWatcherFlowAnalyticsConfiguration": {
"enabled": true,
"workspaceId": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb",
"workspaceRegion": "WorkspaceLocation",
"workspaceResourceId": "/subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourcegroups/WorkspaceRg/providers/microsoft.operationalinsights/workspaces/WorkspaceName"
}
}
Dalam contoh ini, kami mengonfigurasi status pengelogan alur dan Analitik Lalu Lintas untuk Grup Keamanan Jaringan. Dalam respons, kita melihat NSG yang ditentukan telah mengaktifkan pengelogan alur dan Analitik Lalu Lintas, dan tidak ada kebijakan penyimpanan yang ditetapkan.
Parameter
-AsJob
Jalankan cmdlet di latar belakang
Jenis: | SwitchParameter |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | False |
Terima karakter wildcard: | False |
-Confirm
Meminta Anda mengonfirmasi sebelum menjalankan cmdlet.
Jenis: | SwitchParameter |
Alias: | cf |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | False |
Terima karakter wildcard: | False |
-DefaultProfile
Kredensial, akun, penyewa, dan langganan yang digunakan untuk komunikasi dengan azure.
Jenis: | IAzureContextContainer |
Alias: | AzureRmContext, AzureCredential |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | False |
Terima karakter wildcard: | False |
-EnableFlowLog
Bendera untuk mengaktifkan/menonaktifkan pengelogan alur.
Jenis: | Boolean |
Position: | Named |
Nilai default: | None |
Diperlukan: | True |
Terima input alur: | True |
Terima karakter wildcard: | False |
-EnableRetention
Bendera untuk mengaktifkan/menonaktifkan retensi.
Jenis: | Boolean |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | True |
Terima karakter wildcard: | False |
-EnableTrafficAnalytics
Bendera untuk mengaktifkan/menonaktifkan retensi.
Jenis: | SwitchParameter |
Alias: | EnableTA |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | False |
Terima karakter wildcard: | False |
-Location
Lokasi pengamat jaringan.
Jenis: | String |
Position: | Named |
Nilai default: | None |
Diperlukan: | True |
Terima input alur: | True |
Terima karakter wildcard: | False |
-NetworkWatcher
Sumber daya pengamat jaringan.
Jenis: | PSNetworkWatcher |
Position: | Named |
Nilai default: | None |
Diperlukan: | True |
Terima input alur: | True |
Terima karakter wildcard: | False |
-NetworkWatcherName
Nama pengamat jaringan.
Jenis: | String |
Alias: | Name |
Position: | Named |
Nilai default: | None |
Diperlukan: | True |
Terima input alur: | True |
Terima karakter wildcard: | False |
-ResourceGroupName
Nama grup sumber daya pengamat jaringan.
Jenis: | String |
Position: | Named |
Nilai default: | None |
Diperlukan: | True |
Terima input alur: | True |
Terima karakter wildcard: | False |
-RetentionInDays
Jumlah hari untuk menyimpan rekaman log alur.
Jenis: | Int32 |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | True |
Terima karakter wildcard: | False |
-StorageAccountId
ID akun penyimpanan yang digunakan untuk menyimpan log alur.
Jenis: | String |
Position: | Named |
Nilai default: | None |
Diperlukan: | True |
Terima input alur: | True |
Terima karakter wildcard: | False |
-TargetResourceId
ID sumber daya target.
Jenis: | String |
Position: | Named |
Nilai default: | None |
Diperlukan: | True |
Terima input alur: | True |
Terima karakter wildcard: | False |
-WhatIf
Menunjukkan apa yang akan terjadi jika cmdlet berjalan. Cmdlet tidak dijalankan.
Jenis: | SwitchParameter |
Alias: | wi |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | False |
Terima karakter wildcard: | False |
-Workspace
Objek WS yang digunakan untuk menyimpan data analitik lalu lintas.
Jenis: | IOperationalInsightWorkspace |
Position: | Named |
Nilai default: | None |
Diperlukan: | True |
Terima input alur: | True |
Terima karakter wildcard: | False |
-WorkspaceGUID
GUID WS yang digunakan untuk menyimpan data analitik lalu lintas.
Jenis: | String |
Position: | Named |
Nilai default: | None |
Diperlukan: | True |
Terima input alur: | True |
Terima karakter wildcard: | False |
-WorkspaceLocation
Wilayah Azure WS yang digunakan untuk menyimpan data analitik lalu lintas.
Jenis: | String |
Position: | Named |
Nilai default: | None |
Diperlukan: | True |
Terima input alur: | True |
Terima karakter wildcard: | False |
-WorkspaceResourceId
Langganan WS yang digunakan untuk menyimpan data analitik lalu lintas.
Jenis: | String |
Position: | Named |
Nilai default: | None |
Diperlukan: | True |
Terima input alur: | True |
Terima karakter wildcard: | False |
Input
Parameter: NetworkWatcher (ByValue)
Parameter: NetworkWatcherName (ByValue)
Output
Catatan
Kata kunci: azure, azurerm, lengan, sumber daya, manajemen, manajer, jaringan, jaringan, pengamat, aliran, log, flowlog, pengelogan
Link Terkait
- New-AzureRmNetworkWatcher
- Get-AzureRmNetworkWatcher
- Remove-AzureRmNetworkWatcher
- Get-AzureRmNetworkWatcherNextHop
- Get-AzureRmNetworkWatcherSecurityGroupView
- Get-AzureRmNetworkWatcherTopology
- Start-AzureRmNetworkWatcherResourceTroubleshooting
- New-AzureRmNetworkWatcherPacketCapture
- New-AzureRmPacketCaptureFilterConfig
- Get-AzureRmNetworkWatcherPacketCapture
- Remove-AzureRmNetworkWatcherPacketCapture
- Stop-AzureRmNetworkWatcherPacketCapture
- New-AzureRmNetworkWatcherProtocolConfiguration
- Test-AzureRmNetworkWatcherIPFlow
- Test-AzureRmNetworkWatcherConnectivity
- Stop-AzureRmNetworkWatcherConnectionMonitor
- Start-AzureRmNetworkWatcherConnectionMonitor
- Set-AzureRmNetworkWatcherConnectionMonitor
- Set-AzureRmNetworkWatcherConfigFlowLog
- Remove-AzureRmNetworkWatcherConnectionMonitor
- New-AzureRmNetworkWatcherConnectionMonitor
- Get-AzureRmNetworkWatcherTroubleshootingResult
- Get-AzureRMNetworkWatcherReachabilityReport
- Get-AzureRmNetworkWatcherReachabilityProvidersList
- Get-AzureRmNetworkWatcherFlowLogStatus
- Get-AzureRmNetworkWatcherConnectionMonitorReport
- Get-AzureRmNetworkWatcherConnectionMonitor