You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/network-watcher/nsg-flow-logs-portal.md
+51-46Lines changed: 51 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ author: halkazwini
6
6
ms.author: halkazwini
7
7
ms.service: network-watcher
8
8
ms.topic: how-to
9
-
ms.date: 05/30/2024
9
+
ms.date: 07/24/2024
10
10
11
11
#CustomerIntent: As an Azure administrator, I want to log my virtual network IP traffic using Network Watcher NSG flow logs so that I can analyze it later.
12
12
---
@@ -25,14 +25,16 @@ In this article, you learn how to create, change, disable, or delete an NSG flow
25
25
26
26
- A network security group. If you need to create a network security group, see [Create, change, or delete a network security group](../virtual-network/manage-network-security-group.md?tabs=network-security-group-portal).
27
27
28
-
- An Azure storage account. If you need to create a storage account, see [Create a storage account using PowerShell](../storage/common/storage-account-create.md?tabs=azure-portal).
28
+
- An Azure storage account. If you need to create a storage account, see [Create a storage account using the Azure portal](../storage/common/storage-account-create.md?tabs=azure-portal).
29
29
30
30
## Register Insights provider
31
31
32
32
*Microsoft.Insights* provider must be registered to successfully log traffic flowing through a network security group. If you aren't sure if the *Microsoft.Insights* provider is registered, you can check its status by following these steps:
33
33
34
34
1. In the search box at the top of the portal, enter *subscriptions*. Select **Subscriptions** from the search results.
35
35
36
+
:::image type="content" source="./media/nsg-flow-logs-portal/subscriptions.png" alt-text="Screenshot that shows how to search for Subscriptions in the Azure portal." lightbox="./media/nsg-flow-logs-portal/subscriptions.png":::
37
+
36
38
1. Select the Azure subscription that you want to enable the provider for in **Subscriptions**.
37
39
38
40
1. Under **Settings**, select **Resource providers**.
@@ -55,74 +57,74 @@ Create a flow log for your network security group. This NSG flow log is saved in
55
57
56
58
:::image type="content" source="./media/nsg-flow-logs-portal/flow-logs.png" alt-text="Screenshot of Flow logs page in the Azure portal." lightbox="./media/nsg-flow-logs-portal/flow-logs.png":::
57
59
58
-
1.Enter or select the following values in**Create a flow log**:
60
+
1.On the **Basics** tab of**Create a flow log**, enter or select the following values:
59
61
60
62
| Setting | Value |
61
63
| ------- | ----- |
62
64
|**Project details**||
63
65
| Subscription | Select the Azure subscription of your network security group that you want to log. |
| Flow Log Name | Enter a name for the flow log or leave the default name. **myNSG-myResourceGroup-flowlog** is the default name for this example. |
66
+
|Flow log type | Select **Network security group** then select**+ Select target resource**. <br> Select the network security group that you want to flow log, then select **Confirm selection**. |
67
+
| Flow Log Name | Enter a name for the flow log or leave the default name. Azure portal uses ***{ResourceName}-{ResourceGroupName}-flowlog*** as a default name for the flow log. **myNSG-myResourceGroup-flowlog** is the default name used in this article. |
66
68
|**Instance details**||
67
69
| Subscription | Select the Azure subscription of your storage account. |
68
-
| Storage Accounts| Select the storage account that you want to save the flow logs to. If you want to create a new storage account, select **Create a new storage account**. |
69
-
| Retention (days) | Enter a retention time for the logs. Enter *0* if you want to retain the flow logs data in the storage account forever (until you delete it from the storage account). For information about pricing, see [Azure Storage pricing](https://azure.microsoft.com/pricing/details/storage/). |
70
+
| Storage accounts| Select the storage account that you want to save the flow logs to. If you want to create a new storage account, select **Create a new storage account**. |
71
+
| Retention (days) | Enter a retention time for the logs (this option is only available with [Standard general-purpose v2](../storage/common/storage-account-overview.md?toc=/azure/network-watcher/toc.json#types-of-storage-accounts) storage accounts). Enter *0* if you want to retain the flow logs data in the storage account forever (until you delete it from the storage account). For information about pricing, see [Azure Storage pricing](https://azure.microsoft.com/pricing/details/storage/). |
70
72
71
73
:::image type="content" source="./media/nsg-flow-logs-portal/create-nsg-flow-log.png" alt-text="Screenshot of creating an NSG flow log in the Azure portal.":::
72
74
73
75
> [!NOTE]
74
-
> If the storage account is in a different subscription, the network security group and storage account must be associated with the same Azure Active Directory tenant. The account you use for each subscription must have the [necessary permissions](required-rbac-permissions.md).
76
+
> If the storage account is in a different subscription, the network security group and storage account must be associated with the same Microsoft Entra tenant. The account you use for each subscription must have the [necessary permissions](required-rbac-permissions.md).
77
+
78
+
1. To enable traffic analytics, select **Next: Analytics** button, or select the **Analytics** tab. Enter or select the following values:
79
+
80
+
| Setting | Value |
81
+
| ------- | ----- |
82
+
| Flow logs version | Select the version of the network security group flow log, available options are: **Version 1** and **Version 2**. The default version is version 2. For more information, see [Flow logging for network security groups](nsg-flow-logs-overview.md). |
83
+
| Enable traffic analytics | Select the checkbox to enable traffic analytics for your flow log. |
84
+
| Traffic analytics processing interval | Select the processing interval that you prefer, available options are: **Every 1 hour** and **Every 10 mins**. The default processing interval is every one hour. For more information, see [Traffic analytics](traffic-analytics.md). |
85
+
| Subscription | Select the Azure subscription of your Log Analytics workspace. |
86
+
| Log Analytics Workspace | Select your Log Analytics workspace. By default, Azure portal creates ***DefaultWorkspace-{SubscriptionID}-{Region}*** Log Analytics workspace in ***defaultresourcegroup-{Region}*** resource group. |
87
+
88
+
:::image type="content" source="./media/nsg-flow-logs-portal/create-nsg-flow-log-analytics.png" alt-text="Screenshot that shows how to enable traffic analytics for a new flow log in the Azure portal.":::
89
+
90
+
> [!NOTE]
91
+
> To create and select a Log Analytics workspace other than the default one, see [Create a Log Analytics workspace](../azure-monitor/logs/quick-create-workspace.md?toc=/azure/network-watcher/toc.json)
75
92
76
93
1. Select **Review + create**.
77
94
78
95
1. Review the settings, and then select **Create**.
79
96
80
-
## Create a flow log and traffic analytics workspace
97
+
## Enable or disable traffic analytics
81
98
82
-
Create a flow log for your network security group and enable traffic analytics. The NSG flow log is saved in an Azure storage account.
99
+
Enable traffic analytics for a flow log to analyze the flow log data. Traffic analytics provides insights into your traffic patterns. You can enable or disable traffic analytics for a flow log at any time.
100
+
101
+
To enable traffic analytics for a flow log, follow these steps:
83
102
84
103
1. In the search box at the top of the portal, enter *network watcher*. Select **Network Watcher** from the search results.
85
104
86
105
1. Under **Logs**, select **Flow logs**.
87
106
88
-
1. In **Network Watcher | Flow logs**, select **+ Create** or **Create flow log** blue button.
89
-
90
-
:::image type="content" source="./media/nsg-flow-logs-portal/flow-logs.png" alt-text="Screenshot of Flow logs page in the Azure portal." lightbox="./media/nsg-flow-logs-portal/flow-logs.png":::
91
-
92
-
1. Enter or select the following values in **Create a flow log**:
107
+
1. In **Network Watcher | Flow logs**, select the flow log that you want to enable traffic analytics for.
93
108
94
-
| Setting | Value |
95
-
| ------- | ----- |
96
-
|**Project details**||
97
-
| Subscription | Select the Azure subscription of your network security group that you want to log. |
| Flow Log Name | Enter a name for the flow log or leave the default name. By default, Azure portal creates *{network-security-group}-{resource-group}-flowlog* flow log in **NetworkWatcherRG** resource group. |
100
-
|**Instance details**||
101
-
| Subscription | Select the Azure subscription of your storage account. |
102
-
| Storage Accounts | Select the storage account that you want to save the flow logs to. If you want to create a new storage account, select **Create a new storage account**. |
103
-
| Retention (days) | Enter a retention time for the logs. Enter *0* if you want to retain the flow logs data in the storage account forever (until you delete it from the storage account). For information about pricing, see [Azure Storage pricing](https://azure.microsoft.com/pricing/details/storage/). |
104
-
105
-
:::image type="content" source="./media/nsg-flow-logs-portal/create-nsg-flow-log-basics.png" alt-text="Screenshot of the Basics tab of Create a flow log in the Azure portal.":::
109
+
1. In **Flow logs settings**, check the **Enable traffic analytics** checkbox.
106
110
107
-
> [!NOTE]
108
-
> If the storage account is in a different subscription, the network security group and storage account must be associated with the same Azure Active Directory tenant. The account you use for each subscription must have the [necessary permissions](required-rbac-permissions.md).
111
+
:::image type="content" source="./media/nsg-flow-logs-portal/enable-traffic-analytics.png" alt-text="Screenshot that shows how to enable traffic analytics for an existing flow log in the Azure portal." lightbox="./media/nsg-flow-logs-portal/enable-traffic-analytics.png":::
109
112
110
-
1. Select **Next: Analytics** button, or select **Analytics** tab. Then enter or select the following values:
113
+
1. Select the following values:
111
114
112
115
| Setting | Value |
113
116
| ------- | ----- |
114
-
| Flow Logs Version | Select the flow log version. Version 2 is selected by default when you create a flow log using the Azure portal. For more information about flow logs versions, see [Log format of NSG flow logs](nsg-flow-logs-overview.md#log-format). |
115
-
|**Traffic Analytics**||
116
-
| Enable Traffic Analytics | Select the checkbox to enable traffic analytics for your flow log. |
117
-
| Traffic Analytics processing interval | Select the processing interval that you prefer, available options are: **Every 1 hour** and **Every 10 mins**. The default processing interval is every one hour. For more information, see [Traffic Analytics](traffic-analytics.md). |
118
117
| Subscription | Select the Azure subscription of your Log Analytics workspace. |
119
-
| Log Analytics Workspace | Select your Log Analytics workspace. By default, Azure portal creates and selects *DefaultWorkspace-{subscription-id}-{region}* Log Analytics workspace in *defaultresourcegroup-{Region}* resource group. |
118
+
| Log Analytics workspace | Select your Log Analytics workspace. By default, Azure portal creates ***DefaultWorkspace-{SubscriptionID}-{Region}*** Log Analytics workspace in ***defaultresourcegroup-{Region}*** resource group. |
119
+
| Traffic logging interval | Select the processing interval that you prefer, available options are: **Every 1 hour** and **Every 10 mins**. The default processing interval is every one hour. For more information, see [Traffic analytics](traffic-analytics.md). |
120
120
121
-
:::image type="content" source="./media/nsg-flow-logs-portal/enable-traffic-analytics.png" alt-text="Screenshot of enabling traffic analytics for a flow log in the Azure portal.":::
121
+
:::image type="content" source="./media/nsg-flow-logs-portal/enable-traffic-analytics-settings.png" alt-text="Screenshot that shows configurations of traffic analytics for an existing flow log in the Azure portal." lightbox="./media/nsg-flow-logs-portal/enable-traffic-analytics-settings.png":::
122
122
123
-
1. Select **Review + create**.
123
+
1. Select **Save** to apply the changes.
124
124
125
-
1. Review the settings, and then select **Create**.
125
+
To disable traffic analytics for a flow log, take the previous steps 1-3, then uncheck the **Enable traffic analytics** checkbox and select **Save**.
126
+
127
+
:::image type="content" source="./media/nsg-flow-logs-portal/disable-traffic-analytics.png" alt-text="Screenshot that shows how to disable traffic analytics for an existing flow log in the Azure portal." lightbox="./media/nsg-flow-logs-portal/disable-traffic-analytics.png":::
126
128
127
129
## Change a flow log
128
130
@@ -136,14 +138,17 @@ You can change the properties of a flow log after you create it. For example, yo
136
138
137
139
1. In **Flow logs settings**, you can change any of the following settings:
138
140
139
-
-**Flow Logs Version**: Change the flow log version. Available versions are: version 1 and version 2. Version 2 is selected by default when you create a flow log using the Azure portal. For more information about flow logs versions, see [Log format of NSG flow logs](nsg-flow-logs-overview.md#log-format).
140
-
-**Storage Account**: Change the storage account that you want to save the flow logs to. If you want to create a new storage account, select **Create a new storage account**.
141
-
-**Retention (days)**: Change the retention time in the storage account. Enter *0* if you want to retain the flow logs data in the storage account forever (until you manually delete the data from the storage account).
142
-
-**Traffic Analytics**: Enable or disable traffic analytics for your flow log. For more information, see [Traffic Analytics](traffic-analytics.md).
143
-
-**Traffic Analytics processing interval**: Change the processing interval of traffic analytics (if traffic analytics is enabled). Available options are: one hour and 10 minutes. The default processing interval is every one hour. For more information, see [Traffic Analytics](traffic-analytics.md).
144
-
-**Log Analytics workspace**: Change the Log Analytics workspace that you want to save the flow logs to (if traffic analytics is enabled).
145
-
146
-
:::image type="content" source="./media/nsg-flow-logs-portal/change-flow-log.png" alt-text="Screenshot of Flow logs settings page in the Azure portal where you can change some settings." lightbox="./media/nsg-flow-logs-portal/change-flow-log.png":::
141
+
| Setting | Value |
142
+
| ------- | ----- |
143
+
|**Storage account**||
144
+
| Subscription | Change the Azure subscription of the storage account that you want to use. |
145
+
| Storage account | Change the storage account that you want to save the flow logs to. If you want to create a new storage account, select **Create a new storage account**. |
146
+
| Retention (days) | Change the retention time in the storage account. Enter *0* if you want to retain the flow logs data in the storage account forever (until you manually delete the data from the storage account). |
147
+
|**Traffic analytics**||
148
+
| Enable traffic analytics | Enable or disable traffic analytics by checking or unchecking the checkbox. |
149
+
| Subscription | Change the Azure subscription of the Log Analytics workspace that you want to use. |
150
+
| Log analytics workspace | Change the Log Analytics workspace that you want to save the flow logs to (if traffic analytics is enabled). |
151
+
| Traffic logging interval | Change the processing interval of traffic analytics (if traffic analytics is enabled). Available options are: one hour and 10 minutes. The default processing interval is every one hour. For more information, see [Traffic Analytics](traffic-analytics.md). |
0 commit comments