Last active
April 5, 2019 13:12
-
-
Save kenorb/bdceea9dea9cc3a42bfc21346f6f17d4 to your computer and use it in GitHub Desktop.
ELB: Most consuming URLs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE VIEW url_53847374125428073109782528 AS | |
SELECT | |
"sum"("backend_processing_time") "total_ms" | |
, "url" | |
FROM | |
elb_logs_2019 | |
WHERE (("split_part"("request_timestamp", 'T', 1) LIKE '2019-01-%') AND ("regexp_extract"("url", 'sessionId=(.*)', 1) = '53847374125428073109782528')) | |
GROUP BY "url" | |
ORDER BY "total_ms" DESC | |
LIMIT 200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE VIEW this_month_most_consuming_urls AS | |
SELECT | |
"sum"("backend_processing_time") "total_ms" | |
, "url" | |
FROM | |
elb_logs_2019 | |
WHERE ("split_part"("request_timestamp", 'T', 1) LIKE '2019-01-%') | |
GROUP BY "url" | |
ORDER BY "total_ms" DESC | |
LIMIT 50 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE VIEW todays_most_consuming_urls AS | |
SELECT | |
"sum"("backend_processing_time") "total_ms" | |
, "url" | |
FROM | |
elb_logs_2019 | |
WHERE ("split_part"("request_timestamp", 'T', 1) = "split_part"("to_iso8601"(current_timestamp), 'T', 1)) | |
GROUP BY "url" | |
ORDER BY "total_ms" DESC | |
LIMIT 50 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE VIEW total_most_consuming_ips AS | |
SELECT | |
"sum"("backend_processing_time") "total_ms" | |
, "request_ip" | |
FROM | |
elb_logs_2019 | |
WHERE ("backend_ip" <> '') | |
GROUP BY "request_ip" | |
ORDER BY "total_ms" DESC | |
LIMIT 50 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment