GCP FlexReport query to match Service_Description with cloud products in Cost History
search cancel

GCP FlexReport query to match Service_Description with cloud products in Cost History

book

Article ID: 386240

calendar_today

Updated On:

Products

CloudHealth

Issue/Introduction

Below is a query that can be used to line up Cost History cloud products with the Service_Description.

Resolution

Flexreport query:

{
  "sqlStatement": "SELECT timeInterval_Month AS Month, SUM(Cost) AS Cost, Service_Description AS Service_Description FROM GCP_BILLING_EXPORT WHERE (Project_Id IS NOT NULL) AND (Cost_Type LIKE '%regular%') AND (Credit_Name IS NULL) GROUP BY timeInterval_Month, Service_Description ORDER BY Cost DESC",
  "dataGranularity": "MONTHLY",
  "timeRange": {
    "last": 1,
    "excludeCurrent": true
  },
  "limit": -1
}