Skip to content

Commit cdb06ff

Browse files
Merge pull request #266445 from halkazwini/nw-fl
Updates
2 parents 70ab769 + d567311 commit cdb06ff

File tree

2 files changed

+20
-46
lines changed

2 files changed

+20
-46
lines changed

articles/nat-gateway/troubleshoot-nat.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ To analyze outbound traffic from NAT gateway, use NSG flow logs. NSG flow logs p
5959

6060
* To learn more about NSG flow logs, see [NSG flow log overview](../network-watcher/network-watcher-nsg-flow-logging-overview.md).
6161

62-
* For guides on how to enable NSG flow logs, see [Enabling NSG flow logs](../network-watcher/network-watcher-nsg-flow-logging-overview.md#enabling-nsg-flow-logs).
62+
* For guides on how to enable NSG flow logs, see [Managing NSG flow logs](../network-watcher/network-watcher-nsg-flow-logging-overview.md#managing-nsg-flow-logs).
6363

6464
* For guides on how to read NSG flow logs, see [Working with NSG flow logs](../network-watcher/network-watcher-nsg-flow-logging-overview.md#working-with-flow-logs).
6565

articles/network-watcher/network-watcher-nsg-flow-logging-overview.md

Lines changed: 19 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ ms.author: halkazwini
66
author: halkazwini
77
ms.service: network-watcher
88
ms.topic: concept-article
9-
ms.date: 02/07/2024
9+
ms.date: 02/15/2024
1010

1111
#CustomerIntent: As an Azure administrator, I want to learn about NSG flow logs so that I can log my network traffic to analyze and optimize the network performance.
1212
---
1313

1414
# Flow logging for network security groups
1515

16-
Network security groups flow logging is a feature of Azure Network Watcher that allows you to log information about IP traffic flowing through a [network security group](../virtual-network/network-security-groups-overview.md). Flow data is sent to Azure Storage from where you can access it and export it to any visualization tool, security information and event management (SIEM) solution, or intrusion detection system (IDS) of your choice.
16+
Network security group (NSG) flow logging is a feature of Azure Network Watcher that allows you to log information about IP traffic flowing through a [network security group](../virtual-network/network-security-groups-overview.md). Flow data is sent to Azure Storage from where you can access it and export it to any visualization tool, security information and event management (SIEM) solution, or intrusion detection system (IDS) of your choice.
1717

1818
:::image type="content" source="./media/network-watcher-nsg-flow-logging-overview/nsg-flow-logs-portal.png" alt-text="Screenshot showing Network Watcher NSG flow logs page in the Azure portal.":::
1919

@@ -399,68 +399,42 @@ Here's an example bandwidth calculation for flow tuples from a TCP conversation
399399

400400
For continuation (`C`) and end (`E`) flow states, byte and packet counts are aggregate counts from the time of the previous flow's tuple record. In the example conversation, the total number of packets transferred is 1021+52+8005+47 = 9125. The total number of bytes transferred is 588096+29952+4610880+27072 = 5256000.
401401

402-
## Enabling NSG flow logs
402+
## Managing NSG flow logs
403403

404-
For more information about enabling flow logs, see the following guides:
404+
To learn how to create, change, disable, or delete NSG flow logs, see one of the following guides:
405405

406406
- [Azure portal](./nsg-flow-logging.md)
407407
- [PowerShell](./network-watcher-nsg-flow-logging-powershell.md)
408408
- [Azure CLI](./network-watcher-nsg-flow-logging-cli.md)
409409
- [REST API](./network-watcher-nsg-flow-logging-rest.md)
410410
- [Azure Resource Manager](./network-watcher-nsg-flow-logging-azure-resource-manager.md)
411411

412-
## Updating parameters
413-
414-
On the Azure portal:
415-
416-
1. Go to the **NSG flow logs** section in Network Watcher.
417-
1. Select the name of the network security group.
418-
1. On the settings pane for the NSG flow log, change the parameters that you want.
419-
1. Select **Save** to deploy the changes.
420-
421-
To update parameters via command-line tools, use the same command that you used to enable flow logs.
422-
423412
## Working with flow logs
424413

425414
### Read and export flow logs
426415

416+
To learn how to read and export NSG flow logs, see one of the following guides:
417+
427418
- [Download and view flow logs from the portal](./nsg-flow-logging.md#download-a-flow-log)
428419
- [Read flow logs by using PowerShell functions](./network-watcher-read-nsg-flow-logs.md)
429420
- [Export NSG flow logs to Splunk](https://www.splunk.com/en_us/blog/platform/splunking-azure-nsg-flow-logs.html)
430421

431-
NSG flow logs target network security groups and aren't displayed the same way as the other logs. NSG flow logs are stored only in a storage account and follow the logging path shown in the following example:
422+
NSG flow log files are stored in a storage account at the following path:
432423

433424
```
434425
https://{storageAccountName}.blob.core.windows.net/insights-logs-networksecuritygroupflowevent/resourceId=/SUBSCRIPTIONS/{subscriptionID}/RESOURCEGROUPS/{resourceGroupName}/PROVIDERS/MICROSOFT.NETWORK/NETWORKSECURITYGROUPS/{nsgName}/y={year}/m={month}/d={day}/h={hour}/m=00/macAddress={macAddress}/PT1H.json
435426
```
436427

437428
### Visualize flow logs
438429

430+
To learn how to visualize NSG flow logs, see one of the following guides:
431+
439432
- [Visualize NSG flow logs using Network Watcher traffic analytics](./traffic-analytics.md)
440433
- [Visualize NSG flow logs using Power BI](./network-watcher-visualize-nsg-flow-logs-power-bi.md)
441434
- [Visualize NSG flow logs using Elastic Stack](./network-watcher-visualize-nsg-flow-logs-open-source-tools.md)
442435
- [Manage and analyze NSG flow logs using Grafana](./network-watcher-nsg-grafana.md)
443436
- [Manage and analyze NSG flow logs using Graylog](./network-watcher-analyze-nsg-flow-logs-graylog.md)
444437

445-
### Disable flow logs
446-
447-
When you disable an NSG flow log, you stop the flow logging for the associated network security group. But the flow log continues to exist as a resource, with all its settings and associations. You can enable it anytime to begin flow logging on the configured network security group.
448-
449-
You can disable a flow log using the [Azure portal](nsg-flow-logging.md#disable-a-flow-log), [PowerShell](network-watcher-nsg-flow-logging-powershell.md#disable-a-flow-log), the [Azure CLI](network-watcher-nsg-flow-logging-cli.md#disable-a-flow-log), or the [REST API](/rest/api/network-watcher/flow-logs/create-or-update).
450-
451-
For steps to disable and enable NSG flow logs, see [Configure NSG flow logs](./network-watcher-nsg-flow-logging-powershell.md).
452-
453-
### Delete flow logs
454-
455-
When you delete an NSG flow log, you not only stop the flow logging for the associated network security group but also delete the flow log resource (with all its settings and associations). To begin flow logging again, you must create a new flow log resource for that network security group.
456-
457-
You can delete a flow log using the [Azure portal](nsg-flow-logging.md#delete-a-flow-log), [PowerShell](network-watcher-nsg-flow-logging-powershell.md#delete-a-flow-log), the [Azure CLI](network-watcher-nsg-flow-logging-cli.md#delete-a-flow-log), or the [REST API](/rest/api/network-watcher/flow-logs/delete).
458-
459-
When you delete a network security group, the associated flow log resource is deleted by default.
460-
461-
> [!NOTE]
462-
> To move a network security group to a different resource group or subscription, you must delete the associated flow logs. Just disabling the flow logs won't work. After you migrate a network security group, you must re-create the flow logs to enable flow logging on it.
463-
464438
## Considerations for NSG flow logs
465439

466440
### Storage account
@@ -472,22 +446,20 @@ When you delete a network security group, the associated flow log resource is de
472446

473447
### Cost
474448

475-
NSG flow logging is billed on the volume of logs produced. High traffic volume can result in large flow-log volume which increases the associated costs.
449+
NSG flow logging is billed on the volume of produced logs. High traffic volume can result in large flow-log volume, which increases the associated costs.
476450

477-
NSG flow log pricing doesn't include the underlying costs of storage. Using the retention policy feature with NSG flow logs means incurring separate storage costs for extended periods of time.
478-
479-
If you want to retain data forever and don't want to apply a retention policy, set retention days to 0. For more information, see [Network Watcher Pricing](https://azure.microsoft.com/pricing/details/network-watcher/) and [Azure Storage Pricing](https://azure.microsoft.com/pricing/details/storage/blobs/).
451+
NSG flow log pricing doesn't include the underlying costs of storage. Retaining NSG flow logs data forever or using the retention policy feature means incurring storage costs for extended periods of time.
480452

481453
### Non-default inbound TCP rules
482454

483455
Network security groups are implemented as a [stateful firewall](https://en.wikipedia.org/wiki/Stateful_firewall?oldformat=true). But because of current platform limitations, network security group non-default security rules that affect inbound TCP flows are implemented in a stateless way.
484456

485457
Flows affected by non-default inbound rules become non-terminating. Additionally, byte and packet counts aren't recorded for these flows. Because of those factors, the number of bytes and packets reported in NSG flow logs (and Network Watcher traffic analytics) could be different from actual numbers.
486458

487-
You can resolve this difference by setting the `FlowTimeoutInMinutes` property on the associated virtual networks to a non-null value. You can achieve default stateful behavior by setting `FlowTimeoutInMinutes` to 4 minutes. For long-running connections where you don't want flows to disconnect from a service or destination, you can set `FlowTimeoutInMinutes` to a value of up to 30 minutes. Use [Get-AzVirtualNetwork](/powershell/module/az.network/set-azvirtualnetwork) to set `FlowTimeoutInMinutes` property:
459+
You can resolve this difference by setting the `FlowTimeoutInMinutes` property on the associated virtual networks to a non-null value. You can achieve default stateful behavior by setting `FlowTimeoutInMinutes` to 4 minutes. For long-running connections where you don't want flows to disconnect from a service or destination, you can set `FlowTimeoutInMinutes` to a value of up to 30 minutes. Use [Set-AzVirtualNetwork](/powershell/module/az.network/set-azvirtualnetwork) to set `FlowTimeoutInMinutes` property:
488460

489-
```powershell
490-
$virtualNetwork = Get-AzVirtualNetwork -Name myVNet -ResourceGroupName myResourceGroup
461+
```azurepowershell-interactive
462+
$virtualNetwork = Get-AzVirtualNetwork -Name 'myVNet' -ResourceGroupName 'myResourceGroup'
491463
$virtualNetwork.FlowTimeoutInMinutes = 4
492464
$virtualNetwork | Set-AzVirtualNetwork
493465
```
@@ -504,7 +476,7 @@ We don't recommend that you log flows on an Azure ExpressRoute gateway subnet be
504476

505477
### Traffic to a private endpoint
506478

507-
Traffic to private endpoints can only be captured at source VM, the traffic is recorded with source IP address of the VM and destination IP address of the private endpoint. Traffic can't be recorded at the private endpoint itself due to platform limitations.
479+
Traffic to private endpoints can only be captured at source VM. The traffic is recorded with source IP address of the VM and destination IP address of the private endpoint. Traffic can't be recorded at the private endpoint itself due to platform limitations.
508480

509481
### Support for network security groups associated to Application Gateway v2 subnet
510482

@@ -546,7 +518,7 @@ Currently, these Azure services don't support NSG flow logs:
546518

547519
### I can't enable NSG flow logs
548520

549-
If you get an "AuthorizationFailed" or "GatewayAuthenticationFailed" error, you might not have enabled the **Microsoft.Insights** resource provider on your subscription. For more information, see [Register Insights provider](./nsg-flow-logging.md#register-insights-provider).
521+
You might get an *AuthorizationFailed* or *GatewayAuthenticationFailed* error, if you didn't enable the **Microsoft.Insights** resource provider on your subscription before trying to enable NSG flow logs. For more information, see [Register Insights provider](nsg-flow-logging.md#register-insights-provider).
550522

551523
### I enabled NSG flow logs but don't see data in my storage account
552524

@@ -558,7 +530,9 @@ This problem might be related to:
558530

559531
## Pricing
560532

561-
NSG flow logs are charged per gigabyte of *Network flow logs collected* and come with a free tier of 5 GB/month per subscription. If traffic analytics is enabled with NSG flow logs, traffic analytics pricing applies at per gigabyte processing rates. Traffic analytics isn't offered with a free tier of pricing. For more information, see [Network Watcher pricing](https://azure.microsoft.com/pricing/details/network-watcher/).
533+
NSG flow logs are charged per gigabyte of ***Network flow logs collected*** and come with a free tier of 5 GB/month per subscription.
534+
535+
If traffic analytics is enabled with NSG flow logs, traffic analytics pricing applies at per gigabyte processing rates. Traffic analytics isn't offered with a free tier of pricing. For more information, see [Network Watcher pricing](https://azure.microsoft.com/pricing/details/network-watcher/).
562536

563537
Storage of logs is charged separately. For more information, see [Azure Blob Storage pricing](https://azure.microsoft.com/pricing/details/storage/blobs/).
564538

0 commit comments

Comments
 (0)