Skip to content

Instantly share code, notes, and snippets.

@oscarandreu
Last active September 7, 2017 15:16
Show Gist options
  • Save oscarandreu/02e30b506541e996d2134b97aa58c7d3 to your computer and use it in GitHub Desktop.
Save oscarandreu/02e30b506541e996d2134b97aa58c7d3 to your computer and use it in GitHub Desktop.
AIQL statistics per country
let agregationInterval = 1h;
let StartTime = datetime("2017-08-01");
let EndTime = datetime("2017-08-31");
let ips = dynamic(['2.139.214.0', '::1', '0.0.0.0', '127.0.0.0']);
let resultCodes = dynamic(['402']);
let filteredRequests = requests
| where timestamp >= StartTime and timestamp < EndTime and resultCode !in (resultCodes) and client_IP !in (ips) and client_CountryOrRegion != ''
| summarize req = count() by client_IP,client_CountryOrRegion, timestamp;
filteredRequests
| summarize sum=sum(req), avg=avg(req), stdev=stdev(req) by client_CountryOrRegion
| render barchart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment