Learn how to use VQL when querying Network Flow Reports in the API or using the Terraform Provider.
network_flow_logs
, which represents the available filters on Network Flow Reports in the Vantage console. To reference a filter, use the following syntax: namespace.field
(e.g., network_flow_logs.account_id
). The following fields are available within the network_flow_logs
namespace.
Namespace | Field | VQL Example |
---|---|---|
network_flow_logs | account_id | Account ID example |
network_flow_logs | az_id | Availability Zone ID example |
network_flow_logs | dstaddr | Destination Address example |
network_flow_logs | dsthostname | Destination Hostname example |
network_flow_logs | interface_id | Interface ID example |
network_flow_logs | instance_id | Instance ID example |
network_flow_logs | peer_resource_uuid | Peer Resource UUID example |
network_flow_logs | peer_account_id | Peer Account ID example |
network_flow_logs | peer_vpc_id | Peer VPC ID example |
network_flow_logs | peer_regions | Peer Regions example |
network_flow_logs | peer_az_id | Peer AZ ID example |
network_flow_logs | peer_subnet_id | Peer Subnet ID example |
network_flow_logs | peer_interface_id | Peer Interface ID example |
network_flow_logs | peer_instance_id | Peer Instance ID example |
network_flow_logs | region | Region example |
network_flow_logs | resource_uuid | Resource UUID example |
network_flow_logs | srcaddr | Source Address example |
network_flow_logs | srchostname | Source Hostname example |
network_flow_logs | subnet_id | Subnet ID example |
network_flow_logs | traffic_category | Traffic Category example |
network_flow_logs | traffic_path | Traffic Path example |
network_flow_logs | vpc_id | VPC ID example |
provider = 'aws'
, followed by additional filters.
Keyword | Description | VQL Sample | Explanation |
---|---|---|---|
AND | Logical AND operator | (network_flow_logs.account_id = '123456789012') AND (network_flow_logs.dsthostname = 'datadoghq.com') | This example filters for a specific account and destination hostname, where both conditions must be true. |
OR | Logical OR operator | (network_flow_logs.account_id = '123456789012') AND (network_flow_logs.dsthostname = 'datadoghq.com') OR (network_flow_logs.account_id = '09876543212') AND (network_flow_logs.dsthostname = 'github.com') | This example looks for results associated with two accounts and destination hostnames. At least one condition must be true. |
!= | Is not | (network_flow_logs.dsthostname != 'github.com') | This example looks for results that are any destination hostname type except for github.com . |
IN and NOT IN | Used to compare against an array/list | (network_flow_logs.peer_regions IN ('us-east-1','us-west-2')) | This example searches for results within a set of regions. This same query also works for NOT IN where the results are anything matching everything except for these regions: (network_flow_logs.peer_regions NOT IN ('us-east-1','us-west-2')) . |
LIKE and NOT LIKE | Performs string comparisons | (network_flow_logs.az_id LIKE '%use1%') | This example selects data where the Availability Zone contains use1 , such as use1-az1 . This same query also works for NOT LIKE where data does not contain a particular string: (network_flow_logs.az_id NOT LIKE '%use1%') . |
Key | Traffic Path |
---|---|
1 | In VPC |
2 | Internet Gateway or Gateway VPC Endpoint |
3 | Virtual Private Gateway |
4 | Intra-Region VPC Peering |
5 | Inter-Region VPC Peering |
6 | Local Gateway |
7 | Gateway VPC Endpoint (Nitro-based instances) |
8 | Internet Gateway (Nitro-based instances) |
OR
with multiple criteria.