Note: The command-line syntax of logq has changed, so these examples are out of date and will be updated soon.
These are just some quick examples to give you an idea of what can be done.
To populate the database:
$ cat atq.log | \ logq --read --database=atq.db \ --input-type=apache-access \ --input-options='format=recommended-xff,content-type=from-header'
Note that the log format should be specified, but logs in the widely-used "combined" format are handled correctly with the default options.
The following examples assume I already have a database populated:
Top ten pages in the last five days:
$ logq \ --database=atq.db \ --input-type=apache-access \ --query-type=aggregated-preset \ hits/url-path:sdate=$(date -d 'now -5 days' +'%Y-%m-%d'),edate=$(date +'%Y-%m-%d'),content-type=text/html,num=10,sort=-hits ################################################################################ apache-access preset "hits/url-path" -------------------------------------------------------------------------------- url-path|hits /text/kerberos-on-ubuntu/|117 /|95 /software/pytagsfs/|45 /about/|23 /links/|19 /text/|19 /software/sclapp/|17 /text/introduction-to-pytagsfs/|14 /software/pytasks/|13 /text/a-license-for-the-via-vt6656-linux-driver/|13
The same query, but using the text-bar output formatter:
$ logq \ --database=atq.db \ --input-type=apache-access \ --query-type=aggregated-preset \ hits/url-path:sdate=$(date -d 'now -5 days' +'%Y-%m-%d'),edate=$(date +'%Y-%m-%d'),content-type=text/html,num=10,sort=-hits --output-format=text-bar ################################################################################ apache-access preset "hits/url-path" -------------------------------------------------------------------------------- /text/kerberos-on-ubuntu/ ################# 117 ################## / ############## 95 ############## /software/pytagsfs/ ###### 45 ##### /about/ ####### 23 /links/ ###### 19 /text/ ###### 19 /software/sclapp/ ##### 17 /text/introduction-to-pytagsfs/ #### 14 /software/pytasks/ #### 13 /text/...r-the-via-vt6656-linux-driver/ #### 13
Visits per day:
$ logq \ --database=atq.db \ --input-type=apache-access \ --query-type=aggregated-preset \ visits/day:sdate=$(date -d 'now -5 days' +'%Y-%m-%d'),edate=$(date +'%Y-%m-%d'),num=10,sort=day --output-format=text-bar ################################################################################ apache-access preset "visits/day" -------------------------------------------------------------------------------- 2008-04-25 ####################### 189 ####################### 2008-04-26 ################### 164 #################### 2008-04-27 #################### 172 ##################### 2008-04-28 ############################## 241 ############################## 2008-04-29 ################################ 254 ##############################
