Splunk Search

AWS Bill month to date problem.

horizn
New Member

I am trying to build a query to display month to date usage cost per AvailabilityZone/Region. Unfortunately it won't give me current month to date or gives me totally false values (4x higher).

That one gives me costs for the previous month:
sourcetype="aws:billing" | search RecordType=LineItem | search AvailabilityZone!=Unspecified AvailabilityZone!=eu-west-1 AvailabilityZone!=us-east-1 AvailabilityZone!=us-west-2 | timechart span=1mon sum(BlendedCost) as TotalCost by AvailabilityZone limit=20 | eval TotalCost=round(TotalCost,2)

while this one gives me values four times higher than real one:

sourcetype="aws:billing" | search AvailabilityZone != Unspecified CurrencyCode=USD | stats sum(TotalCost) as TotalCost, first(CurrencyCode) as CurrencyCode by AvailabilityZone | eval TotalCost=round(TotalCost,2)

Tags (5)
0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...