Reputation: 11
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
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