compute command

Syntax
$ cd 
$ lw-compute
Usage: /usr/local/bin/lw-compute [options]   
    -g group                         Specify an aggregation group (e.g, hour(_ts_utc), or response.code)
    -c condition                     Specify a condition to match. May be used multiple times
    -s starttime                     Specify the start time for the query
    -e endtime                       Specify the end time for the query
    -v                               Show debug information
    -h, --help                       Display this screen
Examples

Based on the web_log log table, which is created automatically when you use logworm:

$ lw-compute web_log count
	==> Get the total count of logentries in the web_log log
	
	count = 30420.0
$ lw-compute web_log sum profiling
	==> Get the total amount of time spent processing requests 
	==> (profiling is the field that records the number of ms taken by the request)
	
	sum(profiling) = 746.503927999989
$ lw-compute web_log count -g response_status
	==> Count the number of requests by response status (eg, 200, 201, 300, 302, 304, 404, 500)

    [response_status:200] 	 ==> count = 71.0
    [response_status:304] 	 ==> count = 17.0
    [response_status:404] 	 ==> count = 2.0
    [response_status:500] 	 ==> count = 1.0
$ lw-compute web_log count -g response_status -s 2010-03-01
	==> Count the number of requests by response status including only requests since March 1st
$ lw-compute web_log count -g response_status -s 2010-02-01 -e 2010-02-28
	==> Count the number of requests by response status including only requests in February
$ lw-compute web_log count -g response_status -s 2010-02-01 -e 2010-02-28 -c '"request_path":"/foo"'
	==> Count the number of requests of /foo by response status including only requests in February

Back to documentation