-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.lrs
114 lines (82 loc) · 1.79 KB
/
main.lrs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
log-spec: apache-vhost-log
log-title: "Apache Virtual Host Log"
start-rules:
log-rule: vhost
log-is: :built-in:vhost
:end-rule:
log-rule: ip
log-is: :built-in:ip
:end-rule:
log-rule: ident
log-is: :built-in:ident
:end-rule:
log-rule: user
log-is: :built-in:username
:end-rule:
log-rule: date
log-is: :built-in:date
param: :date-format:'%d/%b/%Y:%H:%M:%S %z'
:end-rule:
log-rule: request
log-is: :built-in:http-verb
:end-rule:
log-rule: status
log-is: :built-in:integer
:end-rule:
log-rule: bytes
log-is: :built-in:integer
:end-rule:
log-rule: referrer
log-is: :built-in:uri
:end-rule:
log-rule: user-agent
log-is: :built-in:quoted-value
:end-rule:
:end-rules:
log-tokenize:
| vhost
| ip
| ident
| user
| date
| request
| status
| bytes
| referrer
| user-agent
:end-tokenize:
define-report: country-percent
define-title: "Country Hit Percent"
start-vars:
define-var: country
define-value: :function:geo-locate=$ip|as-is
:end-var:
define-var: size
define-value: :function:sum=$country$bytes|percent
:end-var:
define-var: count
define-value: :function:count=$country$ip|percent
:end-var:
:end-vars:
start-tables:
define-table: country|count,size
table-id: country_count_size
table-title: "Country Hit Percentage"
:end-table:
:end-tables:
start-charts:
define-chart: country|count,size
chart-id: country_count_size
chart-title: "Country Hit Percentage"
chart-use: bar-chart
:end-chart:
:end-charts:
report-structure:
$title:as-is
$date:dd.mm.YYYY
$table:country_count_size
$chart:country_count_size
$output:pdf
:end-structure:
:end-report:
:log-spec-end: