Sum of EU-TransitGateway-Bytes from TGW flow logs does not (always) match the metric in Cost explorer

0

I have a setup with an egress VPC and a Transit Gateway (TGW) in a TGW account. Spoke VPCs send their data to the TGW. When an account sends data to the TGW, it's billed to the source account.

The following query on my TGW flow logs provides me with the top 10 accounts that send data to the TGW. Is this query correct? When I compare the "eu-tgw-gb" value with the EU-TransitGateway-Bytes in Cost Explorer in the source account, it almost always matches. However, I have an account where this value is 650GB according to the TGW Flow logs, but Cost Explorer reports it as 770GB. I don't understand this difference. I checked the same account on other days, and there were also discrepancies. So, it doesn't seem like I am missing flow data, but how can this discrepancy be explained?

select
    tgw_src_vpc_account_id,   
    cast(sum(bytes)/power(1024,3) as decimal(38,3)) as "eu-tgw-gb" /*To convert per account bytes to GB*/
FROM "default"."tgwflowlogs"
WHERE day >= '2024/05/23' AND day <= '2024/05/23' AND "log_status" = 'OK' AND flow_direction = 'ingress'
GROUP BY 1 ORDER BY "eu-tgw-gb" DESC LIMIT 10;

Thanks

1 Answer
0

The first simple check to make is to ensure that you're accounting for time zones in your comparison. The "day" column is presumably parsed from the S3 object keys of the log files, and I think it observes UTC time.

EXPERT
answered 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions