Skip to main content

flow_logs

Creates, updates, deletes, gets or lists a flow_logs resource.

Overview

Nameflow_logs
TypeResource
Idazure.network.flow_logs

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringResource ID.
namestringResource name.
enabledbooleanFlag to enable/disable flow logging.
enabledFilteringCriteriastringOptional field to filter network traffic logs based on SrcIP, SrcPort, DstIP, DstPort, Protocol, Encryption, Direction and Action. If not specified, all network traffic will be logged.
etagstringA unique read-only string that changes whenever the resource is updated.
flowAnalyticsConfigurationobjectParameters that define the configuration of traffic analytics.
formatobjectParameters that define the flow log format.
identityobjectFlowLog resource Managed Identity.
locationstringResource location.
provisioningStatestringThe provisioning state of the flow log. Known values are: "Failed", "Succeeded", "Canceled", "Creating", "Updating", and "Deleting". (Failed, Succeeded, Canceled, Creating, Updating, Deleting)
recordTypesstringOptional field to filter network traffic logs based on flow states. Value of this field could be any comma separated combination string of letters B,C,E or D. B represents Begin, when a flow is created. C represents Continue for an ongoing flow generated at every five-minute interval. E represents End, when a flow is terminated. D represents Deny, when a flow is denied. If not specified, all network traffic will be logged.
retentionPolicyobjectParameters that define the retention policy for flow log.
storageIdstringID of the storage account which is used to store the flow log. Required.
tagsobjectResource tags.
targetResourceGuidstringGuid of network security group to which flow log will be applied.
targetResourceIdstringID of network security group to which flow log will be applied. Required.
typestringResource type.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, network_watcher_name, flow_log_name, subscription_idGets a flow log resource by name.
listselectresource_group_name, network_watcher_name, subscription_idLists all flow log resources for the specified Network Watcher.
create_or_updateinsertresource_group_name, network_watcher_name, flow_log_name, subscription_idCreate or update a flow log for the specified network security group.
update_tagsupdateresource_group_name, network_watcher_name, flow_log_name, subscription_idUpdate tags of the specified flow log.
create_or_updatereplaceresource_group_name, network_watcher_name, flow_log_name, subscription_idCreate or update a flow log for the specified network security group.
deletedeleteresource_group_name, network_watcher_name, flow_log_name, subscription_idDeletes the specified flow log resource.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
flow_log_namestringThe name of the flow log resource. Required.
network_watcher_namestringThe name of the network watcher. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring

SELECT examples

Gets a flow log resource by name.

SELECT
id,
name,
enabled,
enabledFilteringCriteria,
etag,
flowAnalyticsConfiguration,
format,
identity,
location,
provisioningState,
recordTypes,
retentionPolicy,
storageId,
tags,
targetResourceGuid,
targetResourceId,
type
FROM azure.network.flow_logs
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND network_watcher_name = '{{ network_watcher_name }}' -- required
AND flow_log_name = '{{ flow_log_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Create or update a flow log for the specified network security group.

INSERT INTO azure.network.flow_logs (
id,
location,
tags,
properties,
identity,
resource_group_name,
network_watcher_name,
flow_log_name,
subscription_id
)
SELECT
'{{ id }}',
'{{ location }}',
'{{ tags }}',
'{{ properties }}',
'{{ identity }}',
'{{ resource_group_name }}',
'{{ network_watcher_name }}',
'{{ flow_log_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
etag,
identity,
location,
properties,
tags,
type
;

UPDATE examples

Update tags of the specified flow log.

UPDATE azure.network.flow_logs
SET
tags = '{{ tags }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND network_watcher_name = '{{ network_watcher_name }}' --required
AND flow_log_name = '{{ flow_log_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
etag,
identity,
location,
properties,
tags,
type;

REPLACE examples

Create or update a flow log for the specified network security group.

REPLACE azure.network.flow_logs
SET
id = '{{ id }}',
location = '{{ location }}',
tags = '{{ tags }}',
properties = '{{ properties }}',
identity = '{{ identity }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND network_watcher_name = '{{ network_watcher_name }}' --required
AND flow_log_name = '{{ flow_log_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
etag,
identity,
location,
properties,
tags,
type;

DELETE examples

Deletes the specified flow log resource.

DELETE FROM azure.network.flow_logs
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND network_watcher_name = '{{ network_watcher_name }}' --required
AND flow_log_name = '{{ flow_log_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;