This file contains hidden or 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
SELECT | |
ip, | |
avg(resp_time) AS avg_time, | |
domain, | |
path | |
FROM access_log | |
WHERE event_date = '2016-11-01' | |
GROUP BY | |
path, | |
ip, |
This file contains hidden or 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
SELECT | |
ip, | |
avg(resp_time) AS avg_time, | |
domain, | |
path | |
FROM access_log | |
WHERE event_date = '2016-11-01' | |
GROUP BY | |
path, | |
ip, |
This file contains hidden or 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
SELECT | |
toStartOfHour(datetime) AS hours, | |
code, | |
count() AS error_count, | |
bar(error_count, 0, 500) AS error | |
FROM access_log | |
WHERE (event_date = '2016-11-01') AND (code > 399) AND (code < 599) | |
GROUP BY | |
hours, | |
code |
This file contains hidden or 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 TABLE access_log ( | |
event_date Date, | |
hostname String, | |
schema String, | |
domain String, | |
ip String, | |
datetime DateTime, | |
method String, | |
path String, | |
code UInt16, |
This file contains hidden or 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
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use Date::Parse; | |
use DateTime; | |
my $file = $ARGV[0]; | |
my $hostname = $ARGV[1]; |
NewerOlder