Maheswari Basinepalli
Maheswari Basinepalli

Reputation: 11

How to find out concurrency( in a second how many requests are made) in ATHENA for ELB logs

I used this query to get Total counts in a day but I need concurrency per second, I got stuck here.

Please assist me further.

SELECT
 "count"("elb_status_code") "hits"
  
FROM
  alb_logs

WHERE ("date"("from_iso8601_timestamp"("time")) = "date"('2020-09-30'))

Upvotes: 1

Views: 455

Answers (1)

Philipp Johannis
Philipp Johannis

Reputation: 2956

date_trunc should help you - see here

SELECT 
date_trunc('second',"from_iso8601_timestamp"("time"))
,count("elb_status_code") "hits"
FROM alb_logs
WHERE ("date"("from_iso8601_timestamp"("time")) = "date"('2020-09-30'))
group by 1
order by 1

Upvotes: 2

Related Questions