Learn how to use VQL when querying Financial Commitment Reports in the API or using the Terraform Provider.
financial_commitments
, which represents the available filters on Financial Commitment Reports in the Vantage console. To reference a filter, use the following syntax: namespace.field
(e.g., financial_commitments.service
). The following fields are available within the financial_commitments
namespace.
Namespace | Field | VQL Example |
---|---|---|
financial_commitments | provider | provider = 'aws' should be added as the first part of each statement |
financial_commitments | service | Service example |
financial_commitments | resource_account_id | Account example |
financial_commitments | provider_account_id | Billing Account example |
financial_commitments | commitment_type | Commitment Type example |
financial_commitments | commitment_id | Commitment ARN example |
financial_commitments | cost_type | Charge Type example |
financial_commitments | cost_category | Category example |
financial_commitments | cost_sub_category | Subcategory example |
financial_commitments | instance_type | Instance Type example |
financial_commitments | Region | Region example |
financial_commitments | resource_tags | Tags example |
provider = 'aws'
, followed by additional filters.
Keyword | Description | VQL Sample | Explanation |
---|---|---|---|
AND | Logical AND operator | (financial_commitments.provider = 'aws' AND (financial_commitments.resource_tags->>'business-metric' = 'us-east-1a') AND (financial_commitments.cost_category = 'Alarm')) | This example filters for a specific tag and category, where both conditions must be true. |
OR | Logical OR operator | (financial_commitments.provider = 'aws' AND (financial_commitments.resource_tags->>'business-metric' = 'us-east-1a') AND (financial_commitments.resource_tags->>'business-metric' = 'us-east-1b')) | This example looks for results associated with two different tags. At least one condition must be true. |
!= | Is not | (financial_commitments.provider = 'aws' AND (financial_commitments.cost_type != 'Credit')) | This example looks for results that are any charge type except for Credit . |
IN and NOT IN | Used to compare against an array/list | (financial_commitments.provider = 'aws' AND (financial_commitments.resource_tags->>'business-metric' IN ('us-east-1a','us-east-1b','us-east-1c'))) | This example searches for results with the business-metric tag key and multiple values. This same query also works for NOT IN where the results are anything matching the tag key except for those particular values: (financial_commitments.provider = 'aws' AND (financial_commitments.resource_tags->>'business-metric' NOT IN ('us-east-1a','us-east-1b','us-east-1c'))) . |
LIKE and NOT LIKE | Performs string comparisons | (financial_commitments.provider = 'aws' AND (financial_commitments.commitment_id LIKE '%arn:aws:ec2%')) | This example selects data where the commitment ARN value contains arn:aws:ec2 , such as arn:aws:ec2:us-west-2:1234 . This same query also works for NOT LIKE where data does not contain a particular string: (financial_commitments.provider = 'aws' AND (financial_commitments.commitment_id NOT LIKE '%arn:aws:ec2%')) . |
->> | This operator is used only when constructing queries related to tags | (financial_commitments.provider = 'aws' AND (financial_commitments.resource_tags->>'environment' = 'staging')) | This example looks results with the tag name of environment and value of staging . |
us-east-1
.
business-metric
and a list of provided values.
OR
with multiple criteria.