Skip to main content
If you need help constructing a VQL query, navigate to the Resource Reports page and click New Resource Report. From the top left, open the Filters menu. Create a filter and click the View as VQL button at the top of the Filters menu to see a filter’s VQL representation. You can copy this syntax to use within your API calls.

Resource Reports VQL Schema

VQL for Resource Reports comprises two namespaces: resources and tags, which represent the available filters on Resource Reports in the Vantage console. To reference a filter, use the following syntax: namespace.field (e.g., resources.region or tags.name). The following fields are available within these namespaces.
Availability of the fields listed above varies among different cloud providers. See the Resource Reports documentation for a full list of filter fields available per provider.
The VQL tags.name and tags.value fields above are filter fields used inside the filter parameter when creating or updating a Resource Report via the API, or in the filter attribute on the vantage_resource_report Terraform resource.These are distinct from the tags.KEY strings (for example, tags.environment) used inside the columns array on the same API endpoints and Terraform resource. Those are column identifiers for adding tag values as dedicated columns in a Resource Report, not VQL. See Add Tag Columns for details.

Keywords

VQL includes a set of keywords to create complex filter conditions. These keywords function similar to their SQL equivalents. With these operators and keywords, you can construct complex filter conditions in VQL.

VQL Examples

The following examples cover common use cases for VQL.

Combining Providers

Filter for provider resources associated with either AWS or GCP.

Resources from a List of Regions

Filter for AWS resources in two regions. Note that you will need to use the region code, such as us-east-1.

Resources by Account ID

Resources for a specific set of resource types and account ID.

Resources by Billing Account

Resources for a specific billing account.

Resources by Resource Type

Filter resources to see a specific resource type. In the example below, the query is looking for any AWS resource that is not an AWS CloudFront Distribution. Resource types are represented like aws_cloudfront_distribution. Expand the box below for a list of all available resource types and their VQL equivalents.

Resources by Label

Resources by specific label.

Resources for Specific ARN

The UUID is the unique identifier for the resource. In the case of AWS resources, this is the ARN. The below example shows a query for resources that contain specific text within the ARN.

Resources by Metadata

Resource metadata queries require both provider and type as well as metadata. Metadata uses a specific syntax (e.g., resources.metadata->>'domain' = 'vantage.sh').

Filter by Tag

Filter resources based on a specific tag, such as terraform, with the value true, in AWS.

Filter for Untagged Resources

On providers that have a Not Tagged filter option in the console, you can use the below VQL to see untagged resources. This example looks for untagged resources in a multi-cloud environment.