You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
108 lines
4.3 KiB
108 lines
4.3 KiB
<form script="billing_overview.js" version="1.1">
|
|
<label>Billing - Detailed Overview - AWS</label>
|
|
<fieldset submitButton="false" autoRun="true">
|
|
<input type="dropdown" token="accountId">
|
|
<label>Account ID</label>
|
|
<selectFirstChoice>true</selectFirstChoice>
|
|
<fieldForLabel>Account</fieldForLabel>
|
|
<fieldForValue>account_id</fieldForValue>
|
|
<search>
|
|
<query>`aws-billing-monthly-accounts` | `aws-accountid-to-name` | rename LinkedAccountId as account_id</query>
|
|
<earliest>0</earliest>
|
|
<latest></latest>
|
|
</search>
|
|
</input>
|
|
<html>
|
|
<div id="timerange-from"/>
|
|
</html>
|
|
<html>
|
|
<div id="timerange-to"/>
|
|
</html>
|
|
</fieldset>
|
|
<row>
|
|
<panel>
|
|
<single>
|
|
<title>Estimated Cost - Month to Date</title>
|
|
<search>
|
|
<query>`aws-cloudwatch-billing($accountId$, $currency$)`
|
|
| stats sum(Sum) as sum by _time LinkedAccountId metric_dimensions
|
|
| `aws-cloudwatch-dimension-rex("ServiceName", "Service")`
|
|
| eval day=strftime(_time, "%Y/%m/%d")
|
|
| dedup day LinkedAccountId Service sortby -_time
|
|
| `aws-accountid-to-name`
|
|
|timechart span=1d sum(sum) by LinkedAccountId
|
|
| addtotals
|
|
| search Total!=""</query>
|
|
<earliest>@mon</earliest>
|
|
<latest>now</latest>
|
|
</search>
|
|
<option name="drilldown">all</option>
|
|
<option name="field">sum</option>
|
|
<option name="refresh.display">progressbar</option>
|
|
<option name="underLabel">ESTIMATED COST ($currency|currency2Symbol$) - MONTH TO DATE</option>
|
|
<drilldown>
|
|
<link target="_blank">estimated_billing?form.billingAccountId=$accountId$</link>
|
|
</drilldown>
|
|
</single>
|
|
</panel>
|
|
<panel>
|
|
<chart>
|
|
<title>Cost by Service</title>
|
|
<search>
|
|
<query>`aws-billing-monthly-item( (LinkedAccountId="$accountId$"),$currency$, $newmonthspl$)`
|
|
| stats count sum(TotalCost) as TotalCost by LinkedAccountId ProductName BillingPeriodEndDate InvoiceID
|
|
| eventstats sum(count) as count by InvoiceID
|
|
| eval TotalCost=round(TotalCost, 2)
|
|
| `aws-accountid-to-name`
|
|
| stats sum(TotalCost) as TotalCost by ProductName
|
|
| eval TotalCost=round(TotalCost,2)
|
|
| rename TotalCost as "Total Cost" ProductName as Service</query>
|
|
<earliest>0</earliest>
|
|
<latest></latest>
|
|
</search>
|
|
<option name="charting.chart">pie</option>
|
|
<option name="refresh.display">progressbar</option>
|
|
<drilldown>
|
|
<link target="_blank">monthly_billing?form.billingAccountId=$accountId$</link>
|
|
</drilldown>
|
|
</chart>
|
|
</panel>
|
|
</row>
|
|
<row>
|
|
<panel>
|
|
<table>
|
|
<title>Month-over-month Cost</title>
|
|
<search base="baseBudget">
|
|
<query>| accum cost as "Accumulated Cost"
|
|
| rename cost as Cost
|
|
| fieldformat Cost=tostring(Cost,"commas")
|
|
| fieldformat "Accumulated Cost"=tostring('Accumulated Cost',"commas")
|
|
| eval Month = strftime(_time, "%Y-%m")
|
|
| table Month Cost "Accumulated Cost"</query>
|
|
</search>
|
|
<option name="refresh.display">progressbar</option>
|
|
<drilldown>
|
|
<link target="_blank">budget_planner?form.billingAccountId=$accountId$</link>
|
|
</drilldown>
|
|
</table>
|
|
</panel>
|
|
<panel>
|
|
<table>
|
|
<title>Total Cost by Product Name and Operation</title>
|
|
<search>
|
|
<query>| tstats `aws-data-model-acceleration` sum(detailed_billing.BlendedCost) as Cost FROM datamodel=Detailed_Billing where $monthSpl$ (detailed_billing.LinkedAccountId=$accountId$) by detailed_billing.ProductName detailed_billing.Operation | rename detailed_billing.ProductName as "Product Name", detailed_billing.Operation as Operation
|
|
| sort -Cost
|
|
| fieldformat Cost=tostring(round(Cost, 2),"commas")
|
|
| eventstats sum(Cost) as total
|
|
| fields - total</query>
|
|
<earliest>0</earliest>
|
|
<latest></latest>
|
|
</search>
|
|
<option name="refresh.display">progressbar</option>
|
|
<drilldown>
|
|
<link target="_blank">detailed_billing?form.billingAccountId=$accountId$&form.totalcost.groupby=Operation&form.totalcost.groupby=ProductName</link>
|
|
</drilldown>
|
|
</table>
|
|
</panel>
|
|
</row>
|
|
</form> |