Page MenuHomePhabricator
Paste P17774

query.sh
ActivePublic

Authored by Eevans on Thu, Nov 18, 5:31 PM.
#!/bin/bash
TABLENAME="\"local_group_default_T_pageviews_per_project_v2\".data"
PROJECT="en.wikipedia"
STARTTIME="20210101"
ENDTIME="20210131"
for i in all-access desktop mobile-app mobile-web; do
for j in all-agents user spider automated; do
for k in hourly daily monthly; do
printf "SELECT * FROM %s WHERE \"_domain\" = 'analytics.wikimedia.org' AND project = '%s' AND access = '%s' AND agent = '%s' AND granularity = '%s' AND timestamp >= '%s' AND timestamp <= '%s';\n" "$TABLENAME" $PROJECT $i $j $k $STARTTIME $ENDTIME
done
done
done