log_sense 1.0.5 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/Gemfile.lock +2 -2
- data/LICENSE.txt +1 -1
- data/exe/log_sense +3 -2
- data/lib/log_sense/apache_data_cruncher.rb +14 -4
- data/lib/log_sense/emitter.rb +1 -7
- data/lib/log_sense/ip_locator.rb +2 -0
- data/lib/log_sense/options_parser.rb +22 -9
- data/lib/log_sense/rails_data_cruncher.rb +14 -3
- data/lib/log_sense/rails_log_parser.rb +125 -6
- data/lib/log_sense/templates/_command_invocation.html.erb +29 -0
- data/lib/log_sense/templates/_command_invocation.txt.erb +6 -0
- data/lib/log_sense/templates/_output_table.html.erb +1 -1
- data/lib/log_sense/templates/_performance.html.erb +23 -0
- data/lib/log_sense/templates/_performance.txt.erb +9 -0
- data/lib/log_sense/templates/_summary.html.erb +34 -0
- data/lib/log_sense/templates/_summary.txt.erb +10 -0
- data/lib/log_sense/templates/_total_hits.html.erb +32 -0
- data/lib/log_sense/templates/apache.html.erb +216 -299
- data/lib/log_sense/templates/rails.txt.erb +28 -7
- data/lib/log_sense/version.rb +1 -1
- data/sample_logs/empty_log.log +0 -0
- data/sample_logs/safety-critical_org.log +364 -0
- data/sample_logs/spmbook_com.log +1636 -0
- metadata +13 -7
- data/alr-styles.css +0 -61
- data/lib/log_sense/templates/#apache.org.erb# +0 -266
- data/lib/log_sense/templates/.#apache.org.erb +0 -1
- data/lib/log_sense/templates/apache.org.erb +0 -266
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: log_sense
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adolfo Villafiorita
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-11
|
11
|
+
date: 2021-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: apache_log-parser
|
@@ -138,7 +138,6 @@ files:
|
|
138
138
|
- LICENSE.txt
|
139
139
|
- README.org
|
140
140
|
- Rakefile
|
141
|
-
- alr-styles.css
|
142
141
|
- bin/console
|
143
142
|
- bin/setup
|
144
143
|
- exe/log_sense
|
@@ -151,14 +150,21 @@ files:
|
|
151
150
|
- lib/log_sense/options_parser.rb
|
152
151
|
- lib/log_sense/rails_data_cruncher.rb
|
153
152
|
- lib/log_sense/rails_log_parser.rb
|
154
|
-
- lib/log_sense/templates
|
155
|
-
- lib/log_sense/templates
|
153
|
+
- lib/log_sense/templates/_command_invocation.html.erb
|
154
|
+
- lib/log_sense/templates/_command_invocation.txt.erb
|
156
155
|
- lib/log_sense/templates/_output_table.html.erb
|
156
|
+
- lib/log_sense/templates/_performance.html.erb
|
157
|
+
- lib/log_sense/templates/_performance.txt.erb
|
158
|
+
- lib/log_sense/templates/_summary.html.erb
|
159
|
+
- lib/log_sense/templates/_summary.txt.erb
|
160
|
+
- lib/log_sense/templates/_total_hits.html.erb
|
157
161
|
- lib/log_sense/templates/apache.html.erb
|
158
|
-
- lib/log_sense/templates/apache.org.erb
|
159
162
|
- lib/log_sense/templates/rails.txt.erb
|
160
163
|
- lib/log_sense/version.rb
|
161
164
|
- log_sense.gemspec
|
165
|
+
- sample_logs/empty_log.log
|
166
|
+
- sample_logs/safety-critical_org.log
|
167
|
+
- sample_logs/spmbook_com.log
|
162
168
|
homepage: https://www.ict4g.net/gitea/adolfo/log_sense
|
163
169
|
licenses:
|
164
170
|
- MIT
|
@@ -182,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
182
188
|
- !ruby/object:Gem::Version
|
183
189
|
version: '0'
|
184
190
|
requirements: []
|
185
|
-
rubygems_version: 3.
|
191
|
+
rubygems_version: 3.2.32
|
186
192
|
signing_key:
|
187
193
|
specification_version: 4
|
188
194
|
summary: Generate analytics from an Apache and Rails log file.
|
data/alr-styles.css
DELETED
@@ -1,61 +0,0 @@
|
|
1
|
-
nav {
|
2
|
-
position: fixed;
|
3
|
-
}
|
4
|
-
|
5
|
-
section {
|
6
|
-
margin-left: 250px;
|
7
|
-
}
|
8
|
-
|
9
|
-
article {
|
10
|
-
margin-top: 1rem;
|
11
|
-
}
|
12
|
-
|
13
|
-
h1, h2 {
|
14
|
-
color: #222222 !important;
|
15
|
-
}
|
16
|
-
|
17
|
-
/*
|
18
|
-
table {
|
19
|
-
border: 1px solid #222222;
|
20
|
-
border-collapse: collapse;
|
21
|
-
}
|
22
|
-
*/
|
23
|
-
|
24
|
-
table th {
|
25
|
-
background: #444444;
|
26
|
-
color: white;
|
27
|
-
}
|
28
|
-
|
29
|
-
.ip {
|
30
|
-
vertical-align: top;
|
31
|
-
}
|
32
|
-
|
33
|
-
.summary th {
|
34
|
-
text-align: left;
|
35
|
-
}
|
36
|
-
|
37
|
-
.summary td {
|
38
|
-
text-align: right;
|
39
|
-
}
|
40
|
-
|
41
|
-
.hits, .visits, .size, .visitors, .count {
|
42
|
-
text-align: right;
|
43
|
-
font-weight: bold;
|
44
|
-
}
|
45
|
-
|
46
|
-
.referers .size {
|
47
|
-
width: 20%;
|
48
|
-
font-weight: bold;
|
49
|
-
}
|
50
|
-
|
51
|
-
.command-invocation, .log-structure, .performance {
|
52
|
-
width: 60%;
|
53
|
-
}
|
54
|
-
|
55
|
-
.command-invocation th, .log-structure th, .performance th {
|
56
|
-
text-align: left;
|
57
|
-
}
|
58
|
-
|
59
|
-
.log-structure td, .performance td {
|
60
|
-
text-align: right;
|
61
|
-
}
|
@@ -1,266 +0,0 @@
|
|
1
|
-
#+TITLE: Apache Log Analysis: <%= data[:log_file] %>
|
2
|
-
#+DATE: <<%= Date.today %>>
|
3
|
-
#+STARTUP: showall
|
4
|
-
#+OPTIONS: ^:{}
|
5
|
-
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="ala-style.css" />
|
6
|
-
#+OPTIONS: html-style:nil
|
7
|
-
|
8
|
-
* Summary
|
9
|
-
|
10
|
-
| Hits | <%= "%10d" % data[:total_hits][0][0] %> |
|
11
|
-
| Unique Visitors | <%= "%10d" % data[:total_unique_visitors][0][0] %> |
|
12
|
-
| Tx | <%= "%10s" % data[:total_size][0][0] %> |
|
13
|
-
| Logged Period | <%= data[:first_day] %> -- <%= data[:last_day] %> |
|
14
|
-
| Days | <%= "%10d" % data[:total_days] %> |
|
15
|
-
| Period Requested | <%= data[:first_day_requested] %> -- <%= data[:last_day_requested] %> |
|
16
|
-
| Period Analyzed | <%= data[:first_day_in_analysis] %> -- <%= data[:last_day_in_analysis] %> |
|
17
|
-
| Days in Analysis | <%= data[:total_days_in_analysis] %> |
|
18
|
-
|
19
|
-
* Daily Distribution
|
20
|
-
|
21
|
-
<%= self.output_txt_table "daily_distribution", ["Day", "Hits", "Visits", "Size"], data[:daily_distribution] %>
|
22
|
-
|
23
|
-
#+BEGIN_SRC gnuplot :var data = daily_distribution :results output :exports <%= @export %> :file <%= @prefix %>daily<%= @suffix %>.svg
|
24
|
-
reset
|
25
|
-
set grid ytics linestyle 0
|
26
|
-
set grid xtics linestyle 0
|
27
|
-
set terminal svg size 1200,800 fname 'Arial'
|
28
|
-
|
29
|
-
set xdata time
|
30
|
-
set timefmt "%Y-%m-%d"
|
31
|
-
set format x "%a, %b %d"
|
32
|
-
set xtics rotate by 60 right
|
33
|
-
|
34
|
-
set title "Hits and Visitors"
|
35
|
-
set xlabel "Date"
|
36
|
-
set ylabel "Hits"
|
37
|
-
set y2label "Visits"
|
38
|
-
set y2tics
|
39
|
-
|
40
|
-
set style fill transparent solid 0.2 noborder
|
41
|
-
|
42
|
-
plot data using 1:2 with linespoints lw 3 lc rgb "#0000AA" pointtype 5 title "Hits" axes x1y2, \\
|
43
|
-
data using 1:2 with filledcurves below x1 linecolor rgb "#0000AA" notitle axes x1y2, \\
|
44
|
-
data using 1:3 with linespoints lw 3 lc rgb "#AA0000" pointtype 7 title "Visitors", \\
|
45
|
-
data using 1:3 with filledcurves below x1 notitle linecolor rgb "#AA0000", \\
|
46
|
-
data using 1:($3+0.1*$3):3 with labels notitle textcolor rgb "#AA0000", \\
|
47
|
-
data using 1:($2+0.1*$2):2 with labels notitle textcolor rgb "#0000AA" axes x1y2
|
48
|
-
#+END_SRC
|
49
|
-
|
50
|
-
|
51
|
-
* Time Distribution
|
52
|
-
|
53
|
-
<%= self.output_txt_table "time_distribution", ["Hour", "Hits", "Visits", "Size"], data[:time_distribution] %>
|
54
|
-
|
55
|
-
|
56
|
-
#+BEGIN_SRC gnuplot :var data = time_distribution :results output :exports <%= @export %> :file <%= @prefix %>time<%= @suffix %>.svg
|
57
|
-
reset
|
58
|
-
set terminal svg size 1200,800 fname 'Arial' fsize 10
|
59
|
-
|
60
|
-
set grid ytics linestyle 0
|
61
|
-
|
62
|
-
set title "Hits and Visitors"
|
63
|
-
set xlabel "Date"
|
64
|
-
set ylabel "Hits"
|
65
|
-
set y2label "Visitors"
|
66
|
-
set y2tics
|
67
|
-
|
68
|
-
set style fill solid 0.25
|
69
|
-
set boxwidth 0.6
|
70
|
-
|
71
|
-
set style data histograms
|
72
|
-
set style histogram clustered gap 1
|
73
|
-
|
74
|
-
plot data using 2:xtic(1) lc rgb "#0000AA" title "Hits", \\
|
75
|
-
data using 3 lc rgb "#AA0000" title "Visitors" axes x1y2, \\
|
76
|
-
data using ($0 - 0.2):($2 + 0.1*$2):2 with labels title "" textcolor rgb("#0000AA"), \\
|
77
|
-
data using ($0 + 0.2):($3 + 0.1*$3):3 with labels title "" textcolor rgb("#AA0000") axes x1y2
|
78
|
-
#+END_SRC
|
79
|
-
|
80
|
-
#+BEGIN_SRC gnuplot :var data = time_distribution :results output :exports <%= @export %> :file <%= @prefix %>time-traffic<%= @suffix %>.svg
|
81
|
-
reset
|
82
|
-
set terminal svg size 1200,800 fname 'Arial' fsize 10
|
83
|
-
|
84
|
-
set grid ytics linestyle 0
|
85
|
-
|
86
|
-
set title "Traffic"
|
87
|
-
set xlabel "Date"
|
88
|
-
set ylabel "Traffic"
|
89
|
-
|
90
|
-
set style fill solid 0.50
|
91
|
-
set boxwidth 0.6
|
92
|
-
|
93
|
-
set style data histograms
|
94
|
-
set style histogram clustered gap 1
|
95
|
-
|
96
|
-
plot data using 2:xtic(1) lc rgb "#00AA00" title "Traffic", \\
|
97
|
-
data using ($0):($2 + 0.1*$2):2 with labels title "" textcolor rgb("#00AA00")
|
98
|
-
#+END_SRC
|
99
|
-
|
100
|
-
* Most Requested Pages
|
101
|
-
|
102
|
-
<%= self.output_txt_table "most_requested_pages", ["Path", "Hits", "Visits", "Size"], data[:most_requested_pages] %>
|
103
|
-
|
104
|
-
* Most Requested URIs
|
105
|
-
|
106
|
-
<%= self.output_txt_table "most_requested_resources", ["Path", "Hits", "Visits", "Size"], data[:most_requested_resources] %>
|
107
|
-
|
108
|
-
* 404s on HTML files
|
109
|
-
|
110
|
-
<%= self.output_txt_table "pages_404", ["Path", "Hits", "Visitors"], data[:missed_pages] %>
|
111
|
-
|
112
|
-
* 404s on other resources
|
113
|
-
|
114
|
-
<%= self.output_txt_table "resources_404", ["Path", "Hits", "Visitors"], data[:missed_resources] %>
|
115
|
-
|
116
|
-
* Possible Attacks
|
117
|
-
|
118
|
-
<%= self.output_txt_table "attacks", ["Path", "Hits", "Visitors"], data[:attacks] %>
|
119
|
-
|
120
|
-
* Statuses
|
121
|
-
|
122
|
-
<%= self.output_txt_table "statuses", ["Status", "Count"], data[:statuses] %>
|
123
|
-
|
124
|
-
#+BEGIN_SRC gnuplot :var data = statuses :results output :exports <%= @export %> :file <%= @prefix %>statuses<%= @suffix %>.svg
|
125
|
-
reset
|
126
|
-
set grid ytics linestyle 0
|
127
|
-
set terminal svg size 1200,800 fname 'Arial' fsize 10
|
128
|
-
|
129
|
-
set style fill solid 0.25
|
130
|
-
set boxwidth 0.6
|
131
|
-
|
132
|
-
plot data using 2:xtic(1) with boxes lc rgb "#0000AA" title "Hits", \\
|
133
|
-
data using ($0):($2+0.1*$2):2 with labels textcolor rgb "#0000AA"
|
134
|
-
#+END_SRC
|
135
|
-
|
136
|
-
* Daily Statuses
|
137
|
-
|
138
|
-
<%= self.output_txt_table "daily_statuses", ["Status", "2xx", "3xx", "4xx"], data[:statuses_by_day] %>
|
139
|
-
|
140
|
-
#+BEGIN_SRC gnuplot :var data = daily_statuses :results output :exports <%= @export %> :file <%= @prefix %>daily-statuses<%= @suffix %>.svg
|
141
|
-
reset
|
142
|
-
set terminal svg size 1200,800 fname 'Arial' fsize 10
|
143
|
-
|
144
|
-
set grid ytics linestyle 0
|
145
|
-
|
146
|
-
set title "Daily Statuses"
|
147
|
-
set xlabel "Date"
|
148
|
-
set ylabel "Number of Hits"
|
149
|
-
set xtics rotate by 60 right
|
150
|
-
|
151
|
-
set style fill solid 0.25
|
152
|
-
set boxwidth 0.6
|
153
|
-
|
154
|
-
set style data histograms
|
155
|
-
set style histogram clustered gap 1
|
156
|
-
|
157
|
-
plot data using 2:xtic(1) lc rgb "#00AA00" title "2xx", \\
|
158
|
-
data using 3 lc rgb "#0000CC" title "3xx", \\
|
159
|
-
data using 4 lc rgb "#AA0000" title "4xx", \\
|
160
|
-
data using ($0 - 1. / 4):($2 + 0.1*$2):2 with labels title "" textcolor rgb("#00AA00"), \\
|
161
|
-
data using ($0):($3 + 0.1*$3):3 with labels title "" textcolor rgb("#0000CC"), \\
|
162
|
-
data using ($0 + 1. / 4):($4 + 0.1*$4):4 with labels title "" textcolor rgb("#AA0000")
|
163
|
-
#+END_SRC
|
164
|
-
|
165
|
-
* Browsers
|
166
|
-
|
167
|
-
<%= self.output_txt_table "browsers", ["Browser", "Hits", "Visitors", "Size"], data[:browsers] %>
|
168
|
-
|
169
|
-
#+BEGIN_SRC gnuplot :var data = browsers :results output :exports <%= @export %> :file <%= @prefix %>browser<%= @suffix %>.svg
|
170
|
-
reset
|
171
|
-
set grid ytics linestyle 0
|
172
|
-
set terminal svg size 1200,800 fname 'Arial' fsize 10
|
173
|
-
|
174
|
-
set style fill solid 0.25
|
175
|
-
set boxwidth 0.6
|
176
|
-
|
177
|
-
plot data using 2:xtic(1) with boxes lc rgb "#0000AA" title "Hits", \\
|
178
|
-
data using ($0):($2+0.1*$2):2 with labels textcolor rgb "#0000AA"
|
179
|
-
#+END_SRC
|
180
|
-
|
181
|
-
* Platforms
|
182
|
-
|
183
|
-
<%= self.output_txt_table "platforms", ["Platform", "Hits", "Visitors", "Size"], data[:platforms] %>
|
184
|
-
|
185
|
-
#+BEGIN_SRC gnuplot :var data = platforms :results output :exports <%= @export %> :file <%= @prefix %>platforms<%= @suffix %>.svg
|
186
|
-
reset
|
187
|
-
set grid ytics linestyle 0
|
188
|
-
set terminal svg size 1200,800 fname 'Arial' fsize 10
|
189
|
-
|
190
|
-
set style fill solid 0.25
|
191
|
-
set boxwidth 0.6
|
192
|
-
|
193
|
-
plot data using 2:xtic(1) with boxes lc rgb "#0000AA" title "Hits", \\
|
194
|
-
data using ($0):($2+0.1*$2):2 with labels textcolor rgb "#0000AA"
|
195
|
-
#+END_SRC
|
196
|
-
|
197
|
-
* IPs
|
198
|
-
|
199
|
-
<%= self.output_txt_table "ips", ["IPs", "Hits", "Visitors", "Size"], data[:ips] %>
|
200
|
-
|
201
|
-
|
202
|
-
* Referers
|
203
|
-
|
204
|
-
<%= self.output_txt_tabl e"referers", ["Referers", "Hits", "Visitors", "Size"], data[:referers] %>
|
205
|
-
|
206
|
-
#+BEGIN_SRC gnuplot :var data = referers :results output :exports <%= @export %> :file <%= @prefix %>referers<%= @suffix %>.svg
|
207
|
-
reset
|
208
|
-
set terminal svg size 1200,800 fname 'Arial' fsize 10
|
209
|
-
|
210
|
-
set grid ytics linestyle 0
|
211
|
-
set grid xtics linestyle 0
|
212
|
-
|
213
|
-
set title "Referers"
|
214
|
-
set xlabel "Date"
|
215
|
-
set xtics rotate by 60 right
|
216
|
-
set ylabel "Hits and Visits"
|
217
|
-
|
218
|
-
set style fill solid 0.45
|
219
|
-
set boxwidth 0.7
|
220
|
-
|
221
|
-
set style data histograms
|
222
|
-
set style histogram clustered gap 1
|
223
|
-
|
224
|
-
plot data using 2:xtic(1) lc rgb "#AA00AA" title "Hits", \\
|
225
|
-
data using 3 lc rgb "#0AAAA0" title "Visits", \\
|
226
|
-
data using ($0 - 1. / 3):($2 + 0.1*$2):2 with labels title "" textcolor rgb("#AA00AA"), \\
|
227
|
-
data using ($0 + 1. / 3):($3 + 0.1*$3):3 with labels title "" textcolor rgb("#0AAAA0")
|
228
|
-
#+END_SRC
|
229
|
-
|
230
|
-
* Command Invocation and Performance
|
231
|
-
|
232
|
-
** Command Invocation
|
233
|
-
|
234
|
-
#+BEGIN_EXAMPLE shell
|
235
|
-
<%= data[:command] %>
|
236
|
-
#+END_EXAMPLE
|
237
|
-
|
238
|
-
| Input file | <%= "%-50s" % (data[:log_file] || "stdin") %> |
|
239
|
-
| Ignore crawlers | <%= "%-50s" % options[:ignore_crawlers] %> |
|
240
|
-
| Only crawlers | <%= "%-50s" % options[:only_crawlers] %> |
|
241
|
-
| No selfpoll | <%= "%-50s" % options[:no_selfpoll] %> |
|
242
|
-
| Filter by date | <%= "%-50s" % (options[:from_date] != nil or options[:to_date] != nil) %> |
|
243
|
-
| Prefix | <%= "%-50s" % @prefix %> |
|
244
|
-
| Suffix | <%= "%-50s" % @suffix %> |
|
245
|
-
|
246
|
-
** Log Structure
|
247
|
-
|
248
|
-
| Log size | <%= "%10d" % data[:log_size][0][0] %> |
|
249
|
-
| Self poll entries | <%= "%10d" % data[:selfpolls_size][0][0] %> |
|
250
|
-
| Crawlers | <%= "%10d" % data[:crawlers_size][0][0] %> |
|
251
|
-
| Entries considered | <%= "%10d" % data[:total_hits][0][0] %> |
|
252
|
-
|
253
|
-
** Performance
|
254
|
-
|
255
|
-
| Analysis started at | <%= data[:started_at].to_s %> |
|
256
|
-
| Analysis ended at | <%= data[:ended_at].to_s %> |
|
257
|
-
| Duration (sec) | <%= "%5.3d" % data[:duration] %> |
|
258
|
-
| Duration (min) | <%= "%5.3d" % (data[:duration] / 60 ) %> |
|
259
|
-
| Log size | <%= "%9d" % data[:log_size][0][0] %> |
|
260
|
-
| Lines/sec | <%= "%6.2f" % (data[:log_size][0][0] / data[:duration]) %> |
|
261
|
-
|
262
|
-
* Local Variables :noexport:
|
263
|
-
# Local Variables:
|
264
|
-
# org-confirm-babel-evaluate: nil
|
265
|
-
# org-display-inline-images: t
|
266
|
-
# end:
|
@@ -1 +0,0 @@
|
|
1
|
-
lib/log_sense/templates/adolfo@cardassian.537596:1636627399
|
@@ -1,266 +0,0 @@
|
|
1
|
-
#+TITLE: Apache Log Analysis: <%= data[:log_file] %>
|
2
|
-
#+DATE: <<%= Date.today %>>
|
3
|
-
#+STARTUP: showall
|
4
|
-
#+OPTIONS: ^:{}
|
5
|
-
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="ala-style.css" />
|
6
|
-
#+OPTIONS: html-style:nil
|
7
|
-
|
8
|
-
* Summary
|
9
|
-
|
10
|
-
| Hits | <%= "%10d" % data[:total_hits][0][0] %> |
|
11
|
-
| Unique Visitors | <%= "%10d" % data[:total_unique_visitors][0][0] %> |
|
12
|
-
| Tx | <%= "%10s" % data[:total_size][0][0] %> |
|
13
|
-
| Logged Period | <%= data[:first_day] %> -- <%= data[:last_day] %> |
|
14
|
-
| Days | <%= "%10d" % data[:total_days] %> |
|
15
|
-
| Period Requested | <%= data[:first_day_requested] %> -- <%= data[:last_day_requested] %> |
|
16
|
-
| Period Analyzed | <%= data[:first_day_in_analysis] %> -- <%= data[:last_day_in_analysis] %> |
|
17
|
-
| Days in Analysis | <%= data[:total_days_in_analysis] %> |
|
18
|
-
|
19
|
-
* Daily Distribution
|
20
|
-
|
21
|
-
<%= self.output_txt_table "daily_distribution", ["Day", "Hits", "Visits", "Size"], data[:daily_distribution] %>
|
22
|
-
|
23
|
-
#+BEGIN_SRC gnuplot :var data = daily_distribution :results output :exports <%= @export %> :file <%= @prefix %>daily<%= @suffix %>.svg
|
24
|
-
reset
|
25
|
-
set grid ytics linestyle 0
|
26
|
-
set grid xtics linestyle 0
|
27
|
-
set terminal svg size 1200,800 fname 'Arial'
|
28
|
-
|
29
|
-
set xdata time
|
30
|
-
set timefmt "%Y-%m-%d"
|
31
|
-
set format x "%a, %b %d"
|
32
|
-
set xtics rotate by 60 right
|
33
|
-
|
34
|
-
set title "Hits and Visitors"
|
35
|
-
set xlabel "Date"
|
36
|
-
set ylabel "Hits"
|
37
|
-
set y2label "Visits"
|
38
|
-
set y2tics
|
39
|
-
|
40
|
-
set style fill transparent solid 0.2 noborder
|
41
|
-
|
42
|
-
plot data using 1:2 with linespoints lw 3 lc rgb "#0000AA" pointtype 5 title "Hits" axes x1y2, \\
|
43
|
-
data using 1:2 with filledcurves below x1 linecolor rgb "#0000AA" notitle axes x1y2, \\
|
44
|
-
data using 1:3 with linespoints lw 3 lc rgb "#AA0000" pointtype 7 title "Visitors", \\
|
45
|
-
data using 1:3 with filledcurves below x1 notitle linecolor rgb "#AA0000", \\
|
46
|
-
data using 1:($3+0.1*$3):3 with labels notitle textcolor rgb "#AA0000", \\
|
47
|
-
data using 1:($2+0.1*$2):2 with labels notitle textcolor rgb "#0000AA" axes x1y2
|
48
|
-
#+END_SRC
|
49
|
-
|
50
|
-
|
51
|
-
* Time Distribution
|
52
|
-
|
53
|
-
<%= self.output_txt_table "time_distribution", ["Hour", "Hits", "Visits", "Size"], data[:time_distribution] %>
|
54
|
-
|
55
|
-
|
56
|
-
#+BEGIN_SRC gnuplot :var data = time_distribution :results output :exports <%= @export %> :file <%= @prefix %>time<%= @suffix %>.svg
|
57
|
-
reset
|
58
|
-
set terminal svg size 1200,800 fname 'Arial' fsize 10
|
59
|
-
|
60
|
-
set grid ytics linestyle 0
|
61
|
-
|
62
|
-
set title "Hits and Visitors"
|
63
|
-
set xlabel "Date"
|
64
|
-
set ylabel "Hits"
|
65
|
-
set y2label "Visitors"
|
66
|
-
set y2tics
|
67
|
-
|
68
|
-
set style fill solid 0.25
|
69
|
-
set boxwidth 0.6
|
70
|
-
|
71
|
-
set style data histograms
|
72
|
-
set style histogram clustered gap 1
|
73
|
-
|
74
|
-
plot data using 2:xtic(1) lc rgb "#0000AA" title "Hits", \\
|
75
|
-
data using 3 lc rgb "#AA0000" title "Visitors" axes x1y2, \\
|
76
|
-
data using ($0 - 0.2):($2 + 0.1*$2):2 with labels title "" textcolor rgb("#0000AA"), \\
|
77
|
-
data using ($0 + 0.2):($3 + 0.1*$3):3 with labels title "" textcolor rgb("#AA0000") axes x1y2
|
78
|
-
#+END_SRC
|
79
|
-
|
80
|
-
#+BEGIN_SRC gnuplot :var data = time_distribution :results output :exports <%= @export %> :file <%= @prefix %>time-traffic<%= @suffix %>.svg
|
81
|
-
reset
|
82
|
-
set terminal svg size 1200,800 fname 'Arial' fsize 10
|
83
|
-
|
84
|
-
set grid ytics linestyle 0
|
85
|
-
|
86
|
-
set title "Traffic"
|
87
|
-
set xlabel "Date"
|
88
|
-
set ylabel "Traffic"
|
89
|
-
|
90
|
-
set style fill solid 0.50
|
91
|
-
set boxwidth 0.6
|
92
|
-
|
93
|
-
set style data histograms
|
94
|
-
set style histogram clustered gap 1
|
95
|
-
|
96
|
-
plot data using 2:xtic(1) lc rgb "#00AA00" title "Traffic", \\
|
97
|
-
data using ($0):($2 + 0.1*$2):2 with labels title "" textcolor rgb("#00AA00")
|
98
|
-
#+END_SRC
|
99
|
-
|
100
|
-
* Most Requested Pages
|
101
|
-
|
102
|
-
<%= self.output_txt_table "most_requested_pages", ["Path", "Hits", "Visits", "Size"], data[:most_requested_pages] %>
|
103
|
-
|
104
|
-
* Most Requested URIs
|
105
|
-
|
106
|
-
<%= self.output_txt_table "most_requested_resources", ["Path", "Hits", "Visits", "Size"], data[:most_requested_resources] %>
|
107
|
-
|
108
|
-
* 404s on HTML files
|
109
|
-
|
110
|
-
<%= self.output_txt_table "pages_404", ["Path", "Hits", "Visitors"], data[:missed_pages] %>
|
111
|
-
|
112
|
-
* 404s on other resources
|
113
|
-
|
114
|
-
<%= self.output_txt_table "resources_404", ["Path", "Hits", "Visitors"], data[:missed_resources] %>
|
115
|
-
|
116
|
-
* Possible Attacks
|
117
|
-
|
118
|
-
<%= self.output_txt_table "attacks", ["Path", "Hits", "Visitors"], data[:attacks] %>
|
119
|
-
|
120
|
-
* Statuses
|
121
|
-
|
122
|
-
<%= self.output_txt_table "statuses", ["Status", "Count"], data[:statuses] %>
|
123
|
-
|
124
|
-
#+BEGIN_SRC gnuplot :var data = statuses :results output :exports <%= @export %> :file <%= @prefix %>statuses<%= @suffix %>.svg
|
125
|
-
reset
|
126
|
-
set grid ytics linestyle 0
|
127
|
-
set terminal svg size 1200,800 fname 'Arial' fsize 10
|
128
|
-
|
129
|
-
set style fill solid 0.25
|
130
|
-
set boxwidth 0.6
|
131
|
-
|
132
|
-
plot data using 2:xtic(1) with boxes lc rgb "#0000AA" title "Hits", \\
|
133
|
-
data using ($0):($2+0.1*$2):2 with labels textcolor rgb "#0000AA"
|
134
|
-
#+END_SRC
|
135
|
-
|
136
|
-
* Daily Statuses
|
137
|
-
|
138
|
-
<%= self.output_txt_table "daily_statuses", ["Status", "2xx", "3xx", "4xx"], data[:statuses_by_day] %>
|
139
|
-
|
140
|
-
#+BEGIN_SRC gnuplot :var data = daily_statuses :results output :exports <%= @export %> :file <%= @prefix %>daily-statuses<%= @suffix %>.svg
|
141
|
-
reset
|
142
|
-
set terminal svg size 1200,800 fname 'Arial' fsize 10
|
143
|
-
|
144
|
-
set grid ytics linestyle 0
|
145
|
-
|
146
|
-
set title "Daily Statuses"
|
147
|
-
set xlabel "Date"
|
148
|
-
set ylabel "Number of Hits"
|
149
|
-
set xtics rotate by 60 right
|
150
|
-
|
151
|
-
set style fill solid 0.25
|
152
|
-
set boxwidth 0.6
|
153
|
-
|
154
|
-
set style data histograms
|
155
|
-
set style histogram clustered gap 1
|
156
|
-
|
157
|
-
plot data using 2:xtic(1) lc rgb "#00AA00" title "2xx", \\
|
158
|
-
data using 3 lc rgb "#0000CC" title "3xx", \\
|
159
|
-
data using 4 lc rgb "#AA0000" title "4xx", \\
|
160
|
-
data using ($0 - 1. / 4):($2 + 0.1*$2):2 with labels title "" textcolor rgb("#00AA00"), \\
|
161
|
-
data using ($0):($3 + 0.1*$3):3 with labels title "" textcolor rgb("#0000CC"), \\
|
162
|
-
data using ($0 + 1. / 4):($4 + 0.1*$4):4 with labels title "" textcolor rgb("#AA0000")
|
163
|
-
#+END_SRC
|
164
|
-
|
165
|
-
* Browsers
|
166
|
-
|
167
|
-
<%= self.output_txt_table "browsers", ["Browser", "Hits", "Visitors", "Size"], data[:browsers] %>
|
168
|
-
|
169
|
-
#+BEGIN_SRC gnuplot :var data = browsers :results output :exports <%= @export %> :file <%= @prefix %>browser<%= @suffix %>.svg
|
170
|
-
reset
|
171
|
-
set grid ytics linestyle 0
|
172
|
-
set terminal svg size 1200,800 fname 'Arial' fsize 10
|
173
|
-
|
174
|
-
set style fill solid 0.25
|
175
|
-
set boxwidth 0.6
|
176
|
-
|
177
|
-
plot data using 2:xtic(1) with boxes lc rgb "#0000AA" title "Hits", \\
|
178
|
-
data using ($0):($2+0.1*$2):2 with labels textcolor rgb "#0000AA"
|
179
|
-
#+END_SRC
|
180
|
-
|
181
|
-
* Platforms
|
182
|
-
|
183
|
-
<%= self.output_txt_table "platforms", ["Platform", "Hits", "Visitors", "Size"], data[:platforms] %>
|
184
|
-
|
185
|
-
#+BEGIN_SRC gnuplot :var data = platforms :results output :exports <%= @export %> :file <%= @prefix %>platforms<%= @suffix %>.svg
|
186
|
-
reset
|
187
|
-
set grid ytics linestyle 0
|
188
|
-
set terminal svg size 1200,800 fname 'Arial' fsize 10
|
189
|
-
|
190
|
-
set style fill solid 0.25
|
191
|
-
set boxwidth 0.6
|
192
|
-
|
193
|
-
plot data using 2:xtic(1) with boxes lc rgb "#0000AA" title "Hits", \\
|
194
|
-
data using ($0):($2+0.1*$2):2 with labels textcolor rgb "#0000AA"
|
195
|
-
#+END_SRC
|
196
|
-
|
197
|
-
* IPs
|
198
|
-
|
199
|
-
<%= self.output_txt_table "ips", ["IPs", "Hits", "Visitors", "Size"], data[:ips] %>
|
200
|
-
|
201
|
-
|
202
|
-
* Referers
|
203
|
-
|
204
|
-
<%= self.output_txt_table "referers", ["Referers", "Hits", "Visitors", "Size"], data[:referers] %>
|
205
|
-
|
206
|
-
#+BEGIN_SRC gnuplot :var data = referers :results output :exports <%= @export %> :file <%= @prefix %>referers<%= @suffix %>.svg
|
207
|
-
reset
|
208
|
-
set terminal svg size 1200,800 fname 'Arial' fsize 10
|
209
|
-
|
210
|
-
set grid ytics linestyle 0
|
211
|
-
set grid xtics linestyle 0
|
212
|
-
|
213
|
-
set title "Referers"
|
214
|
-
set xlabel "Date"
|
215
|
-
set xtics rotate by 60 right
|
216
|
-
set ylabel "Hits and Visits"
|
217
|
-
|
218
|
-
set style fill solid 0.45
|
219
|
-
set boxwidth 0.7
|
220
|
-
|
221
|
-
set style data histograms
|
222
|
-
set style histogram clustered gap 1
|
223
|
-
|
224
|
-
plot data using 2:xtic(1) lc rgb "#AA00AA" title "Hits", \\
|
225
|
-
data using 3 lc rgb "#0AAAA0" title "Visits", \\
|
226
|
-
data using ($0 - 1. / 3):($2 + 0.1*$2):2 with labels title "" textcolor rgb("#AA00AA"), \\
|
227
|
-
data using ($0 + 1. / 3):($3 + 0.1*$3):3 with labels title "" textcolor rgb("#0AAAA0")
|
228
|
-
#+END_SRC
|
229
|
-
|
230
|
-
* Command Invocation and Performance
|
231
|
-
|
232
|
-
** Command Invocation
|
233
|
-
|
234
|
-
#+BEGIN_EXAMPLE shell
|
235
|
-
<%= data[:command] %>
|
236
|
-
#+END_EXAMPLE
|
237
|
-
|
238
|
-
| Input file | <%= "%-50s" % (data[:log_file] || "stdin") %> |
|
239
|
-
| Ignore crawlers | <%= "%-50s" % options[:ignore_crawlers] %> |
|
240
|
-
| Only crawlers | <%= "%-50s" % options[:only_crawlers] %> |
|
241
|
-
| No selfpoll | <%= "%-50s" % options[:no_selfpoll] %> |
|
242
|
-
| Filter by date | <%= "%-50s" % (options[:from_date] != nil or options[:to_date] != nil) %> |
|
243
|
-
| Prefix | <%= "%-50s" % @prefix %> |
|
244
|
-
| Suffix | <%= "%-50s" % @suffix %> |
|
245
|
-
|
246
|
-
** Log Structure
|
247
|
-
|
248
|
-
| Log size | <%= "%10d" % data[:log_size][0][0] %> |
|
249
|
-
| Self poll entries | <%= "%10d" % data[:selfpolls_size][0][0] %> |
|
250
|
-
| Crawlers | <%= "%10d" % data[:crawlers_size][0][0] %> |
|
251
|
-
| Entries considered | <%= "%10d" % data[:total_hits][0][0] %> |
|
252
|
-
|
253
|
-
** Performance
|
254
|
-
|
255
|
-
| Analysis started at | <%= data[:started_at].to_s %> |
|
256
|
-
| Analysis ended at | <%= data[:ended_at].to_s %> |
|
257
|
-
| Duration (sec) | <%= "%5.3d" % data[:duration] %> |
|
258
|
-
| Duration (min) | <%= "%5.3d" % (data[:duration] / 60 ) %> |
|
259
|
-
| Log size | <%= "%9d" % data[:log_size][0][0] %> |
|
260
|
-
| Lines/sec | <%= "%6.2f" % (data[:log_size][0][0] / data[:duration]) %> |
|
261
|
-
|
262
|
-
* Local Variables :noexport:
|
263
|
-
# Local Variables:
|
264
|
-
# org-confirm-babel-evaluate: nil
|
265
|
-
# org-display-inline-images: t
|
266
|
-
# end:
|