Created
June 6, 2017 11:11
-
-
Save bbelchak/b453f5a96df08f0ecb40c1dbe6db90f8 to your computer and use it in GitHub Desktop.
How to get the cost of your Internet Egress in GCP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT labels.key, labels.value, project.name, resource_type, start_time, end_time, SUM(cost) as cost FROM FLATTEN(( | |
SELECT | |
* | |
FROM ( | |
FLATTEN(( | |
SELECT | |
* | |
FROM | |
[YOUR_TABLE_HERE]), | |
labels.key) | |
) | |
), | |
project.labels.value) | |
WHERE resource_type LIKE "%Internet Egress%" | |
group by labels.key, labels.value, project.name, resource_type, start_time, end_time ORDER by start_time desc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment