About VPC Flow Logs records

This page describes the VPC Flow Logs record format, includingwhich base and metadata fields are available. It also explains how you can uselog filtering so that only logs that match certain criteria are generated.

Record format

Log records contain base fields, which are the core fields of every log record,and metadata fields that add additional information. Metadata fields may beomitted to save storage costs.

Some log fields are in a multi-field format, with more than one piece of datain a given field. For example, theconnection field is of theIpConnectionformat, which contains the source and destination IP address and port, plus theprotocol, in a single field. These multi-field fields are described below therecord format table.

The values for metadata fields aren't based on the data plane path;they are approximations and might be missing or incorrect. Unlike metadatafields, the values for base fields are taken directly from packet headers.

FieldField formatField type: Base or optional metadata
connectionIpConnection
5-tuple describing the flow.
Base
reporter string
The side that reported the flow.
  • For VMs and serverless endpoints, the reporter can beSRC orDEST.
  • For gateways such as VLAN attachments for Cloud Interconnect and Cloud VPN tunnels, the reporter can beSRC_GATEWAY orDEST_GATEWAY.
Base
rtt_msec int64
Round-trip time (RTT) in milliseconds as measured during the aggregation interval. This field is populated as follows:
  • Measured only for TCP traffic
  • Populated for VMs and serverless endpoints
  • Not populated for VLAN attachments and Cloud VPN tunnels

The measured RTT is the time elapsed between sending a SEQ and receiving a corresponding ACK.

Base
round_trip_timeLatencies
RTT in milliseconds with sub-millisecond precision as measured during the aggregation interval. This field is populated for TCP (for VMs and serverless endpoints) and Falcon traffic.
  • For TCP traffic, the measured latency is the time elapsed between sending a SEQ and receiving a corresponding ACK.
  • For Falcon traffic, the latency is the hardware-measured RTT.
Base
bytes_sent int64
Estimated number of user payload bytes sent from the source to the destination.1 For packets with no user payload, the value is zero.2
Base
packets_sent int64
Estimated number of packets sent from the source to the destination.1
Base
start_time string
Timestamp (RFC 3339 date string format) of the first observed packet during the aggregated time interval.
Base
end_time string
Timestamp (RFC 3339 date string format) of the last observed packet during the aggregated time interval.
Base
Source and destination metadata fields
src_gatewayGatewayDetails
If the source of the flow is an on-premises or other cloud endpoint that is connected to Google Cloud through a gateway such as a VLAN attachment for Cloud Interconnect or a Cloud VPN tunnel and either of the following conditions is met, this field is populated with gateway details:
  • The source gateway is the reporter of the flow.
  • The destination of the flow is the reporter, and either of the following is true:
    • The source gateway is in the same project as the destination of the flow.
    • VPC Flow Logs is configured at the organization level, and cross-project annotations aren't disabled.3
Metadata
dest_gatewayGatewayDetails
If the destination of the flow is an on-premises or other cloud endpoint that is connected to Google Cloud through a gateway such as a VLAN attachment for Cloud Interconnect or a Cloud VPN tunnel and either of the following conditions is met, this field is populated with gateway details:
  • The destination gateway is the reporter of the flow.
  • The source of the flow is the reporter, and either of the following is true:
    • The destination gateway is in the same project as the source of the flow.
    • VPC Flow Logs is configured at the organization level, and cross-project annotations aren't disabled.3
Metadata
src_gke_detailsGkeDetails
If the source of the flow is a Google Kubernetes Engine (GKE) endpoint, this field is populated with GKE endpoint details.
Metadata
dest_gke_detailsGkeDetails
If the destination of the flow is a GKE endpoint, this field is populated with GKE endpoint details.
Metadata
src_google_serviceGoogleServiceDetails
If the source of the flow is a Google service, this field is populated with service details.
Metadata
dest_google_serviceGoogleServiceDetails
If the destination of the flow is a Google service, this field is populated with service details.
Metadata
src_instanceInstanceDetails
If the source of the flow is a VM located in a VPC network and either of the following conditions is met, this field is populated with VM instance details:
  • The source VM is the reporter of the flow.
  • The destination of the flow is the reporter, and either of the following is true:
    • The source VM, or the VPC network that the source VM is attached to, is in the same project as the destination of the flow.
    • VPC Flow Logs is configured at the organization level, and cross-project annotations aren't disabled.3
Metadata
dest_instanceInstanceDetails
If the destination of the flow is a VM located in a VPC network and either of the following conditions is met, this field is populated with VM instance details.
  • The destination VM is the reporter of the flow.
  • The source of the flow is the reporter, and either of the following is true:
    • The destination VM, or the VPC network that the destination VM is attached to, is in the same project as the source of the flow.
    • VPC Flow Logs is configured at the organization level, and cross-project annotations aren't disabled.3
Metadata
src_locationGeographicDetails
If the source of the flow is a public IP address outside of the VPC network, this field is populated with available location metadata.
Metadata
dest_locationGeographicDetails
If the destination of the flow is a public IP address outside of the VPC network, this field is populated with available location metadata.
Metadata
src_serverless_detailsServerlessDetails
If the source of the flow is a serverless endpoint such as a Cloud Run resource configured with Direct VPC egress, this field is populated with serverless metadata.
Metadata
dest_serverless_detailsServerlessDetails
If the destination of the flow is a serverless endpoint such as a Cloud Run resource configured with Direct VPC egress, this field is populated with serverless metadata.
Metadata
src_vpcVpcDetails
If the source of the flow is a VM or serverless endpoint located in a VPC network and either of the following conditions is met, this field is populated with VPC network details:
  • The source resource is the reporter of the flow.
  • The destination of the flow is the reporter, and either of the following is true:
    • The source resource, or the VPC network that the source resource is attached to, is in the same project as the destination of the flow.
    • VPC Flow Logs is configured at the organization level, and cross-project annotations aren't disabled.3
Metadata
dest_vpcVpcDetails
If the destination of the flow is a VM or serverless endpoint located in a VPC network and either of the following conditions is met, this field is populated with VPC network details:
  • The destination resource is the reporter of the flow.
  • The source of the flow is the reporter, and either of the following is true:
    • The destination resource, or the VPC network that the destination resource is attached to, is in the same project as the source of the flow.
    • VPC Flow Logs is configured at the organization level, and cross-project annotations aren't disabled.3
Metadata
Other metadata fields
internet_routing_detailsInternetRoutingDetails
If the flow is between Google Cloud and the internet, this field is populated with routing details. Available only for egress flows.
Metadata
load_balancingLoadBalancingDetails
If the flow passes through a load balancer in one of the following configurations, this field is populated with Cloud Load Balancing details:
  • The reporter of the flow is the client of the load balancer, and the load balancer type isAPPLICATION_LOAD_BALANCER,PROXY_NETWORK_LOAD_BALANCER,PASSTHROUGH_NETWORK_LOAD_BALANCER, orPROTOCOL_FORWARDING.
  • The reporter of the flow is the backend of the load balancer, and the load balancer type isPASSTHROUGH_NETWORK_LOAD_BALANCER orPROTOCOL_FORWARDING.
Metadata
network_serviceNetworkServiceDetails
If the Differentiated Services Code Point (DSCP) header is set, this field is populated with network service details.
Metadata
pscPrivateServiceConnectDetails
If the flow passes through Private Service Connect in either of the following configurations, this field is populated with Private Service Connect details:
  • The reporter of the Private Service Connect traffic is a consumer and is using a Private Service Connect endpoint that targets a published service or global Google APIs.
  • The reporter of the Private Service Connect traffic is a producer and is using an internal passthrough Network Load Balancer or internal protocol forwarding.
Metadata
rdma_traffic_type string
Type of RDMA traffic. Populated for GPU-to-GPU traffic between VMs. Can beGPUDirect-TCPXO,Falcon, orRoCE.
Metadata
1 Estimated total based on sampled packets. For best accuracy, aggregate logs across longer time periods or multiple resources. For more information about accuracy and sampling, seeVPC Flow Logs: Understanding byte and packet countsandLog sampling and processing.
2 For Falcon traffic, the bytes sent value is calculated differently for the source and destination:
  • If the source VM is the reporter, the reported bytes value is the sum of the user payload bytes and packet header bytes sent. This value is always greater than zero, even for packets containing no user payload.
  • If the destination VM is the reporter, the reported bytes value is the user payload bytes received and forwarded to the application layer. For packets with no user payload, the bytes value is zero.
3 If VPC Flow Logs is configured at the organization level, by default, log records for cross-project flows include details about both sides of the flow. Cross-project annotations are available for flows through Shared VPC, VPC Network Peering, and Network Connectivity Center. For more information, seeCross-project annotations.

IpConnection field format

FieldTypeDescription
protocolint32The IANA protocol number:
  • Populated for TCP, UDP, ICMP, ESP, and GRE flows
  • Not populated for RDMA flows
src_ipstringSource IP address. Populated for all flows.
dest_ipstringDestination IP address. Populated for all flows.
src_portint32Source port:
  • Populated for TCP and UDP flows
  • Not populated for ICMP, ESP, GRE, and RDMA flows
dest_portint32Destination port:
  • Populated for TCP and UDP flows
  • Not populated for ICMP, ESP, GRE, and RDMA flows

GatewayDetails field format

FieldTypeDescription
project_idstringGoogle Cloud project ID of the gateway
locationstringRegion of the gateway
namestringName of the gateway
typestring Type of the gateway. Can beINTERCONNECT_ATTACHMENT orVPN_TUNNEL.
vpcVpcDetails VPC network details of the gateway
interconnect_namestring If the type of the gateway isINTERCONNECT_ATTACHMENT, this field is populated with the name of the Cloud Interconnect connection on which the VLAN attachment is configured.
interconnect_project_numberint64 If the type of the gateway isINTERCONNECT_ATTACHMENT, this field is populated with the Google Cloud project number of the Cloud Interconnect connection on which the VLAN attachment is configured.

GkeDetails field format

FieldTypeDescription
clusterClusterDetailsGKE cluster metadata
podPodDetails GKE Pod metadata, populated when the source or destination of the traffic is a Pod
serviceServiceDetails GKE Service metadata, populated in Service endpoints only. The record contains up to two Services. If there are more than two relevant Services, this field contains a single Service with a specialMANY_SERVICES marker.

ClusterDetails field format

FieldTypeDescription
cluster_locationstring Location of the cluster. This can be a zone or a region depending if the cluster is zonal or regional.
cluster_namestringGKE cluster name.

PodDetails field format

FieldTypeDescription
pod_namestringName of the Pod
pod_namespacestringNamespace of the Pod
workloadWorkloadDetailsMetadata about the top-level workload resource that controls the Pod
WorkloadDetails field format
FieldTypeDescription
workload_namestringName of the top-level workload controller
workload_typestring Type of the top-level workload controller. Can beDEPLOYMENT,REPLICA_SET,STATEFUL_SET,DAEMON_SET,JOB,CRON_JOB, orREPLICATION_CONTROLLER.

ServiceDetails field format

FieldTypeDescription
service_namestring Name of the Service. If there are more than two relevant Services, the field is set to a specialMANY_SERVICES marker.
service_namespacestringNamespace of the Service

Example:

If there are two services, the Service field looks like this:

service: [ 0: {  service_name: "my-lb-service"  service_namespace: "default" } 1: {  service_name: "my-lb-service2"  service_namespace: "default" }]

If there are more than two services, the Service field looks like this:

service: [ 0: {  service_name: "MANY_SERVICES" }]

GoogleServiceDetails field format

FieldTypeDescription
typestring

The type of service, eitherGOOGLE_API orGOOGLE_VPC_HOSTED_SERVICE:

service_namestring

Name of the service. For example,pubsub.googleapis.com.

Limitations:

  • The service name might be missing for requests to Google APIs that take longer than 60 seconds to complete.
  • If a VM or gateway uses the same 5-tuple to connect to multiple services, the log record contains the name of only one of the services, selected randomly.
connectivitystring

Access method. For theGOOGLE_API type, the connectivity field can be one of the following:

  • PUBLIC_IP, if the API is accessed from a VM with an external IP address
  • PRIVATE_GOOGLE_ACCESS orDIRECT_CONNECTIVITY, if the API is accessed through Private Google Access
  • PRIVATE_SERVICE_CONNECT_FOR_GOOGLE_APIS, if the API is accessed through Private Service Connect endpoints

For theGOOGLE_VPC_HOSTED_SERVICE type, the connectivity field can be one of the following:

  • PUBLIC_IP, if the service is accessed through public IP connectivity
  • PRIVATE_SERVICES_ACCESS, if the service is accessed through private services access
  • PRIVATE_SERVICE_CONNECT_ENDPOINT orPRIVATE_SERVICE_CONNECT_INTERFACE, if the service is accessed through Private Service Connect
private_domainstring

Private domain or Private Service Connect API bundle. The private_domain field can be one of the following:

  • For thePRIVATE_GOOGLE_ACCESS access method:private.googleapis.com orrestricted.googleapis.com
  • For theDIRECT_CONNECTIVITY access method:restricted.googleapis.com
  • For thePRIVATE_SERVICE_CONNECT_FOR_GOOGLE_APIS access method:all-apis orvpc-sc

InstanceDetails field format

FieldTypeDescription
project_idstringID of the Google Cloud project that contains the VM resource
regionstringRegion of the VM
vm_namestringInstance name of the VM
zonestringZone of the VM
managed_instance_groupInstanceGroupDetails If the VM is part of a managed instance group, this field is populated with instance group details.

InstanceGroupDetails field format

FieldTypeDescription
namestringName of the instance group
regionstringIf the instance group is regional, this field is populated with the region of the instance group.
zonestringIf the instance group is zonal, this field is populated with the zone of the instance group.

GeographicDetails field format

FieldTypeDescription
asnint32 The ASN of the external network to which this endpoint belongs.
citystringCity for external endpoints
continentstringContinent for external endpoints
countrystring Country for external endpoints, represented as ISO 3166-1 Alpha-3 country codes
regionstringRegion for external endpoints

VpcDetails field format

FieldTypeDescription
project_idstringID of the Google Cloud project that contains the VPC. In a Shared VPC configuration, the project ID is the ID of the host project.
subnetwork_namestring Name of the subnet, if applicable
subnetwork_regionstringRegion of the subnet, if applicable
vpc_namestringName of the network

InternetRoutingDetails field format

FieldTypeDescription
egress_as_pathAsPathList of relevant AS paths. If there are multiple AS paths available to the flow, the field might contain more than one AS path.

AsPath field format

FieldTypeDescription
as_detailsAsDetailsList of AS details for all systems in the AS path. The list starts from the first AS that is external to Google Cloud's network and ends with the AS to which the remote IP address belongs.

AsDetails field format

FieldTypeDescription
asnuint32The autonomous system number (ASN) of the AS

Latencies

FieldTypeDescription
median_msecdoubleThe median latency in milliseconds as measured during the aggregation interval.

LoadBalancingDetails field format

FieldTypeDescription
forwarding_rule_project_idstringGoogle Cloud project ID of the forwarding rule
reporterstringCloud Load Balancing reporter. Can be eitherCLIENT orBACKEND.
  • If the reporter of the flow is the client of the load balancer, this field is set toCLIENT.
  • If the reporter of the flow is the backend of the load balancer, this field is set toBACKEND.
typestringLoad balancer type. Can beAPPLICATION_LOAD_BALANCER,PROXY_NETWORK_LOAD_BALANCER,PASSTHROUGH_NETWORK_LOAD_BALANCER, orPROTOCOL_FORWARDING.
schemestringLoad balancer scheme. Can beEXTERNAL_MANAGED,INTERNAL_MANAGED,EXTERNAL,INTERNAL, orINTERNAL_SELF_MANAGED.
url_map_namestringName of the URL map. Populated if the type of the load balancer isAPPLICATION_LOAD_BALANCER.
forwarding_rule_namestringName of the forwarding rule
backend_service_namestringName of the backend service. Populated if the reporter isBACKEND and load balancer type isPASSTHROUGH_NETWORK_LOAD_BALANCER. If the backend group type isTARGET_POOL, this field isn't populated.
backend_group_namestringName of the backend group. Populated if the reporter isBACKEND and load balancer type isPASSTHROUGH_NETWORK_LOAD_BALANCER.
backend_group_typestringType of the backend group. Can beINSTANCE_GROUP,NETWORK_ENDPOINT_GROUP, orTARGET_POOL. Populated if the reporter isBACKEND and the load balancer type isPASSTHROUGH_NETWORK_LOAD_BALANCER.
backend_group_locationstringLocation of the backend group. Can be a zone or a region depending on whether the scope of the backend group is zonal or regional. Populated if the reporter isBACKEND and the load balancer type isPASSTHROUGH_NETWORK_LOAD_BALANCER. If the backend group type isTARGET_POOL, this field isn't populated.
vpcVpcDetails VPC network details of the load balancer

NetworkServiceDetails field format

FieldTypeDescription
dscpint32If the Differentiated Services field is present in packet headers, this field is populated with the DSCP value.

PrivateServiceConnectDetails field format

FieldTypeDescription
reporterstringPrivate Service Connect reporter. Can be eitherCONSUMER orPRODUCER.
psc_endpointPrivateServiceConnectEndpointDetails Endpoint details. Populated if the reporter isCONSUMER.
psc_attachmentPrivateServiceConnectAttachmentDetails Service attachment details. Populated if the traffic flow includes a Private Service Connect producer.

PrivateServiceConnectEndpointDetails field format

FieldTypeDescription
project_idstringGoogle Cloud project ID of the Private Service Connect endpoint
regionstringRegion of the endpoint. Not populated if the target service type isGLOBAL_GOOGLE_APIS.
psc_connection_idstringPrivate Service Connect connection ID
target_service_typestringTarget service type. Can be eitherGLOBAL_GOOGLE_APIS orPUBLISHED_SERVICE.
vpcVpcDetails VPC network details of the Private Service Connect endpoint

PrivateServiceConnectAttachmentDetails field format

FieldTypeDescription
project_idstringGoogle Cloud project ID of the service attachment
regionstringRegion of the service attachment
vpcVpcDetails VPC network details of the service attachment

ServerlessDetails field format

FieldTypeDescription
project_idstringID of the Google Cloud project that contains the Cloud Run resource. In a Shared VPC configuration, the project ID is usually the ID of the service project.
regionstringRegion of the Cloud Run resource

One of the following:

  • cloud_run_service_details
  • cloud_run_job_details
  • cloud_run_worker_pool_details

One of the following:

Name of the Cloud Run resource

CloudRunServiceDetails field format

FieldTypeDescription
service_namestringName of the Cloud Run service

CloudRunJobDetails field format

FieldTypeDescription
job_namestringName of the Cloud Run job

CloudRunWorkerPoolDetails field format

FieldTypeDescription
worker_pool_namestringName of the Cloud Run worker pool

Metadata annotations

Log records contain base fields and metadata fields. TheRecordformat section lists which fields are type metadata and which are type base. All basefields are always included. You can customize which metadata fields you keep.

  • If you select all metadata, all metadata fields in the VPC Flow Logsrecord format are included in the flow logs. When new metadata fields are addedto the record format, the flow logs automatically include the new fields.

  • If you select no metadata, this omits all metadata fields.

  • If you select custom metadata, you can specify the metadata fields that youwant to include by the parent field, such assrc_vpc, or by their full names,such assrc_vpc.project_id

    When new metadata fields are added to therecord format, they're excluded from the flow logs unless they'rewithin a parent field that you have specified to include.

    • If you specify custom metadata using parent fields, when new metadatafields are added to the record format within that parent field, the flow logswill automatically include the new fields.

    • If you specify custom metadata using the full name of the field, newmetadata fields that are added to the parent field are excluded from the flowlogs.

For information about how to customize metadata fields, seeEnable VPC Flow LogsorUpdate VPC Flow Logs configuration.

GKE metadata annotations

Flows that have an endpoint in a GKE Cluster can be annotatedwithGKE metadata annotations, which can includedetails of the Cluster, Pod, and Service of the endpoint.

GKE Service annotations

Traffic sent to a ClusterIP, NodePort, or LoadBalancer can receiveService annotations. If sent to a NodePort or LoadBalancer, the flow receivesthe Service annotation on both hops of the connection.

Traffic sent directly to a Pod's Service port is annotated with a Serviceannotation on the destination endpoint.

Traffic sent to a Pod's Service port where the Pod is backing morethan one Service on the same Service port is annotated with multiple Serviceson the destination endpoint. This is limited to two Services. If there are morethan that, the endpoint will be annotated with a specialMANY_SERVICESmarker.

Pod annotations on internet traffic

Traffic between a Pod and the internet doesn't receive Pod annotations bydefault. VPC Flow Logs can't add Pod annotations because,for packets to the internet, the masquerade agent translates thePod IP address to the node IP address before VPC Flow Logs seesthe packet.

Because of the masquerade, Pod annotations are only visible if the destinationsare within eitherthe default non-masqueradedestinationsor in acustomnonMasqueradeCIDRslist.If you include internet destinations in a customnonMasqueradeCIDRs list, youneed to provide a way for the internal Pod IP addresses to be translated beforethey are delivered to the internet. For both private and non-private clusters,you can use Cloud NAT. SeeGKEinteraction for more details.

Cross-project annotations

If VPC Flow Logs isenabled at the organization level,flows through Shared VPC, VPC Network Peering, and Network Connectivity Centerare annotated with cross-project annotations. Cross-project annotations areenabled by default. You can optionally disable these annotations.

  • If cross-project annotations are enabled, log records for flows betweenresources in different projectsinclude information about both sides of the flow.
  • If cross-project annotations are disabled, log records include informationonly about the reporter of the flow.

If VPC Flow Logs is enabled at the project level,flows between resources in different projects aren't annotated withcross-project annotations.

Log filtering

When you enable VPC Flow Logs, you can set a filter based on both base andmetadata fields that only preserves logs that match the filter. All other logsare discarded before being written to Logging.

You can filter on any subset of fields listed inRecord format,except for the following fields:

  • rtt_msec
  • bytes_sent
  • packets_sent
  • start_time
  • end_time

VPC Flow Logs filtering uses CEL, an embedded expression language forattribute-based logic expressions. Filter expressions for VPC Flow Logshave a limit of 2,048 characters. For more information, seeSupported CEL logic operators.

For more information about CEL, see theCELintroduction and thelanguagedefinition.The generation filter feature supports a limited subset of CEL syntax.

To create a VPC Flow Logs configurationthat uses log filtering, seeEnable VPC Flow Logs.To configure log filtering for an existing VPC Flow Logsconfiguration, seeUpdate VPC Flow Logs configuration.For examples of log filters, seeExamples of log filters.

Supported CEL logic operators

ExpressionSupported typesDescription
true, falsebooleanBoolean constants

x == y

x != y

boolean, int, string

Comparison operators

Example: connection.protocol == 6

x && y

x || y

boolean

Boolean logic operators

Example: connection.protocol == 6 && src_instance.vm_name == "vm_1"

!xbooleanNegation
1, 2.0, 0, ...intConstant numeric literals
x + ystringString concatenation
"foo", 'foo', ...stringConstant string literal
x.lower()stringReturns the lowercase value of the string
x.upper()stringReturns the uppercase value of the string
x.contains(y)stringReturns true if the string contains the specified substring
x.startsWith(y)stringReturns true if the string begins with the specified substring
x.endsWith(y)stringReturns true if the string ends with the specified substring
inIpRange(X, Y)string

Returns true if X is an IP and Y is an IP range that contains X

Example: inIpRange("1.2.3.1", "1.2.3.0/24")

x.containsFieldValue(y) x: list
y: map(string, string)

Returns true if the list contains an object with fields that match the specified key-value pairs

Example: dest_gke_details.service.containsFieldValue({'service_name': 'service1', 'service_namespace': 'namespace1'})

has(x) string

Returns true if the field is present.

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-18 UTC.