Skip to content

Commit 1667cc8

Browse files
Merge pull request #313593 from Srijan-Chak012/patch-24
Added section on RecordType Filtering
2 parents 56fb648 + bdb4d87 commit 1667cc8

1 file changed

Lines changed: 36 additions & 13 deletions

File tree

articles/network-watcher/vnet-flow-logs-filtering.md

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: halkazwini
66
ms.author: halkazwini
77
ms.service: azure-network-watcher
88
ms.topic: how-to
9-
ms.date: 12/26/2025
9+
ms.date: 03/24/2026
1010
---
1111

1212
# Filter virtual network flow logs (preview)
@@ -93,10 +93,33 @@ Set-AzNetworkWatcherFlowLog -Enabled $true -Name 'myVNetFlowLog' -NetworkWatcher
9393
-EnableTrafficAnalytics -TrafficAnalyticsWorkspaceId $workspace.ResourceId `
9494
-EnableRetention $true -RetentionPolicyDays 15
9595
```
96+
## Filtering based on RecordTypes
9697

97-
## Update RecordTypes filtering condition
98+
You can filter virtual network flow logs based on the state of a network flow. Flow state represents the lifecycle stage of a connection as observed by Network Watcher, such as when a flow begins, continues, ends, or is denied.
9899

99-
You can enable RecordTypes filtering during flow log creation by choosing which flow record formats to collect in order to tailor logging output without generating unnecessary data.
100+
Use the RecordTypes parameter to specify which flow states you want to record. The parameter accepts one or more comma‑separated values.
101+
102+
### Supported RecordType Values
103+
104+
| Value | Description |
105+
|-------|-------------|
106+
| B | Begin: when a flow is created. No statistics are provided. |
107+
| C | Continuing: an ongoing flow. Statistics are provided at five-minute intervals. |
108+
| E | End: when a flow is terminated. Statistics are provided. |
109+
| D | Deny: when a flow is denied. |
110+
111+
### Example scenarios using RecordTypes
112+
113+
| Scenario | RecordTypes value |
114+
|----------|-------------------|
115+
| Capture only denied traffic | "D" |
116+
| Capture flow creation and termination events | "B,E" |
117+
| Capture only active traffic statistics | "C" |
118+
| Capture full flow lifecycle | "B,C,E" |
119+
120+
## Manage RecordTypes filtering condition
121+
122+
You can enable RecordTypes filtering during flow log creation by choosing which flow record formats to collect in order to tailor logging output without generating unnecessary data. You can also update RecordTypes filterning condition for an existing flow log.
100123

101124
```azurepowershell-interactive
102125
# Enable RecordTypes filtering while creating flowlog
@@ -110,37 +133,37 @@ New-AzNetworkWatcherFlowLog `
110133
```
111134

112135
```azurepowershell-interactive
113-
# Update RecordTypes filtering condition on existing flow log
114-
Set-AzNetworkWatcherFlowLog `
115-
-Enabled $true -Name <FlowLog Name> `
136+
# Enable RecordTypes and EnabledFilteringCriteria filtering while creating flow log
137+
New-AzNetworkWatcherFlowLog `
138+
-Enabled $true -Name <FlowLog Name> `
116139
-NetworkWatcherName <Network Watcher Name> `
117140
-ResourceGroupName <Resource Group Name> `
118141
-StorageId <Storage Account ID> `
119142
-TargetResourceId <Target Resource/VNet ID> `
143+
-EnabledFilteringCriteria "<Filtering Criteria Expression>" `
120144
-RecordTypes "<Record Types>"
121145
```
122146

123147
```azurepowershell-interactive
124-
# Remove RecordTypes filtering condition from existing flow log
148+
# Update RecordTypes filtering condition on existing flow log
125149
Set-AzNetworkWatcherFlowLog `
126150
-Enabled $true -Name <FlowLog Name> `
127151
-NetworkWatcherName <Network Watcher Name> `
128152
-ResourceGroupName <Resource Group Name> `
129153
-StorageId <Storage Account ID> `
130154
-TargetResourceId <Target Resource/VNet ID> `
131-
-RecordTypes ""
155+
-RecordTypes "<Record Types>"
132156
```
133157

134158
```azurepowershell-interactive
135-
# Enable RecordTypes and EnabledFilteringCriteria filtering while creating flow log
136-
New-AzNetworkWatcherFlowLog `
137-
-Enabled $true -Name <FlowLog Name> `
159+
# Remove RecordTypes filtering condition from existing flow log
160+
Set-AzNetworkWatcherFlowLog `
161+
-Enabled $true -Name <FlowLog Name> `
138162
-NetworkWatcherName <Network Watcher Name> `
139163
-ResourceGroupName <Resource Group Name> `
140164
-StorageId <Storage Account ID> `
141165
-TargetResourceId <Target Resource/VNet ID> `
142-
-EnabledFilteringCriteria "<Filtering Criteria Expression>" `
143-
-RecordTypes "<Record Types>"
166+
-RecordTypes ""
144167
```
145168

146169
## Related content

0 commit comments

Comments
 (0)