apache_log_report 1.1.4 → 1.1.5
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4cd01d24bc31eb2fe1107781a94578b43210fdc7d63dd65190643e637dc8da1
|
4
|
+
data.tar.gz: f1889cc37617847862274bd3d65fab82662d5c8e988129a227ed80b1fe4b7887
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 520c9648ccd15f9a3bc0b1761989bb091bc81cf7f16eac6cf5bc5bb73c0aef3e47a03eafd85f468c08834dbf93163c4b750ef31d61b63d277f546afcd21082b2
|
7
|
+
data.tar.gz: a1833663a335da90513d1054117b9ca39b2f9802c021f7f75dda929312c00e32e7a3725901454c3a3f583839d0addbf511f08e421117f2317892fe1fe1f93628
|
@@ -39,12 +39,24 @@ module ApacheLogReport
|
|
39
39
|
END AS size
|
40
40
|
EOS
|
41
41
|
|
42
|
+
human_readable_day = <<-EOS
|
43
|
+
case cast (strftime('%w', datetime) as integer)
|
44
|
+
when 0 then 'Sunday'
|
45
|
+
when 1 then 'Monday'
|
46
|
+
when 2 then 'Tuesday'
|
47
|
+
when 3 then 'Wednesday'
|
48
|
+
when 4 then 'Thursday'
|
49
|
+
when 5 then 'Friday'
|
50
|
+
else 'Saturday'
|
51
|
+
end as dow
|
52
|
+
EOS
|
53
|
+
|
42
54
|
@total_hits = db.execute "SELECT count(datetime) from LogLine where #{filter}"
|
43
55
|
@total_unique_visitors = db.execute "SELECT count(distinct(unique_visitor)) from LogLine where #{filter}"
|
44
56
|
@total_size = db.execute "SELECT #{human_readable_size} from LogLine where #{filter}"
|
45
57
|
@total_days = (Date.parse(@last_day[0][0]) - Date.parse(@first_day[0][0])).to_i
|
46
58
|
|
47
|
-
@daily_distribution = db.execute "SELECT date(datetime), count(datetime), count(distinct(unique_visitor)), #{human_readable_size} from LogLine where #{filter} group by date(datetime)"
|
59
|
+
@daily_distribution = db.execute "SELECT date(datetime), #{human_readable_day}, count(datetime), count(distinct(unique_visitor)), #{human_readable_size} from LogLine where #{filter} group by date(datetime)"
|
48
60
|
@time_distribution = db.execute "SELECT strftime('%H', datetime), count(datetime), count(distinct(unique_visitor)), #{human_readable_size} from LogLine where #{filter} group by strftime('%H', datetime)"
|
49
61
|
@most_requested_pages = db.execute "SELECT path, count(path), count(distinct(unique_visitor)), #{human_readable_size} from LogLine where extension == '.html' and #{filter} group by path order by count(path) desc limit #{options[:limit]}"
|
50
62
|
@most_requested_resources = db.execute "SELECT path, count(path), count(distinct(unique_visitor)), #{human_readable_size} from LogLine where #{filter} group by path order by count(path) desc limit #{options[:limit]}"
|
@@ -10,42 +10,43 @@
|
|
10
10
|
<link rel="stylesheet" href="https://unpkg.com/spectre.css/dist/spectre-icons.min.css">
|
11
11
|
</head>
|
12
12
|
|
13
|
-
<body
|
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
|
-
<
|
13
|
+
<body>
|
14
|
+
<div class="container">
|
15
|
+
<nav>
|
16
|
+
<ul class="nav">
|
17
|
+
<li class="nav-item active">
|
18
|
+
<a href="#">Navigation</a>
|
19
|
+
<ul class="nav">
|
20
|
+
<% [ "Summary",
|
21
|
+
"Log Structure",
|
22
|
+
"Daily Distribution",
|
23
|
+
"Time Distribution",
|
24
|
+
"Most Requested Pages",
|
25
|
+
"Most Requested Resources",
|
26
|
+
"404 on HTML Files",
|
27
|
+
"404 on other Resources",
|
28
|
+
"Attacks",
|
29
|
+
"Statuses",
|
30
|
+
"Daily Statuses",
|
31
|
+
"Browsers",
|
32
|
+
"Platforms",
|
33
|
+
"Referers",
|
34
|
+
"IPs"
|
35
|
+
].each do |item| %>
|
36
|
+
<li class="nav-item">
|
37
|
+
<a href="#<%= item.downcase.gsub(' ', '-') %>"><%= item %></a>
|
38
|
+
</li>
|
39
|
+
<% end %>
|
40
|
+
</ul>
|
41
|
+
</li>
|
42
|
+
</ul>
|
43
|
+
</nav>
|
44
|
+
|
45
|
+
<section>
|
46
|
+
<h1>Apache Log Analysis: <%= data[:log_file] || "stdin" %></h1>
|
47
|
+
|
48
|
+
<div class="columns">
|
49
|
+
<article class="col-6 column">
|
49
50
|
<h2 id="summary">Summary</h2>
|
50
51
|
|
51
52
|
<table class="table summary">
|
@@ -74,8 +75,8 @@
|
|
74
75
|
<td class="days"><%= data[:total_days] %></td>
|
75
76
|
</tr>
|
76
77
|
</table>
|
77
|
-
|
78
|
-
|
78
|
+
</article>
|
79
|
+
<article class="column col-6">
|
79
80
|
<h2 id="log-structure">Log Structure</h2>
|
80
81
|
|
81
82
|
<table class="table log-structure">
|
@@ -102,43 +103,43 @@
|
|
102
103
|
</tr>
|
103
104
|
</tbody>
|
104
105
|
</table>
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
106
|
+
</article>
|
107
|
+
</div>
|
108
|
+
|
109
|
+
<% @reports = [
|
110
|
+
{ title: "Daily Distribution", header: ["Day", "DOW", "Hits", "Visits", "Size"], rows: data[:daily_distribution] },
|
111
|
+
{ title: "Time Distribution", header: ["Hour", "Hits", "Visits", "Size"], rows: data[:time_distribution] },
|
112
|
+
{ title: "Most Requested Pages", header: ["Path", "Hits", "Visits", "Size"], rows: data[:most_requested_pages] },
|
113
|
+
{ title: "Most Requested Resources", header: ["Path", "Hits", "Visits", "Size"], rows: data[:most_requested_resources] },
|
114
|
+
{ title: "404 on HTML Files", header: ["Path", "Hits", "Visitors"], rows: data[:missed_pages] },
|
115
|
+
{ title: "404 on other Resources", header: ["Path", "Hits", "Visitors"], rows: data[:missed_resources] },
|
116
|
+
{ title: "Attacks", header: ["Path", "Hits", "Visitors"], rows: data[:attacks] },
|
117
|
+
{ },
|
118
|
+
{ title: "Statuses", header: ["Status", "Count"], rows: data[:statuses] },
|
119
|
+
{ title: "Daily Statuses", header: ["Status", "2xx", "3xx", "4xx"], rows: data[:statuses_by_day] },
|
120
|
+
{ title: "Browsers", header: ["Browser", "Hits", "Visitors", "Size"], rows: data[:browsers] },
|
121
|
+
{ title: "Platforms", header: ["Platform", "Hits", "Visitors", "Size"], rows: data[:platforms] },
|
122
|
+
{ title: "Referers", header: ["Referers", "Hits", "Visitors", "Size"], rows: data[:referers], col: "col-12" },
|
123
|
+
{ title: "IPs", header: ["IPs", "Hits", "Visitors", "Size"], rows: data[:ips] },
|
124
|
+
{ },
|
125
|
+
]
|
126
|
+
%>
|
127
|
+
<div class="columns">
|
128
|
+
<% @reports.each do |report| %>
|
129
|
+
<div class="column <%= report[:col] || "col-6" %>">
|
130
|
+
<article>
|
131
|
+
<% if report[:title] != nil %>
|
132
|
+
<h2 id="<%= report[:title].downcase.gsub(/ +/, '-') %>">
|
133
|
+
<%= report[:title] %>
|
134
|
+
</h2>
|
135
|
+
<%= render "output_table", report %>
|
136
|
+
<% end %>
|
137
|
+
</article>
|
138
|
+
</div>
|
139
|
+
<% end %>
|
140
|
+
</div>
|
140
141
|
|
141
|
-
|
142
|
+
<article>
|
142
143
|
<h2 id="streaks">Streaks</h2>
|
143
144
|
|
144
145
|
<table class="table streaks">
|
@@ -163,11 +164,11 @@
|
|
163
164
|
<% end %>
|
164
165
|
</tbody>
|
165
166
|
</table>
|
166
|
-
|
167
|
+
</article>
|
167
168
|
|
168
|
-
|
169
|
-
|
170
|
-
|
169
|
+
<div class="columns">
|
170
|
+
<div class="column col-6">
|
171
|
+
<article>
|
171
172
|
<h2 id="command-invocation">Command Invocation</h2>
|
172
173
|
|
173
174
|
<table class="table command-invocation">
|
@@ -207,11 +208,11 @@
|
|
207
208
|
</tr>
|
208
209
|
</tbody>
|
209
210
|
</table>
|
210
|
-
|
211
|
-
|
211
|
+
</article>
|
212
|
+
</div>
|
212
213
|
|
213
|
-
|
214
|
-
|
214
|
+
<div class="column col-6">
|
215
|
+
<article>
|
215
216
|
<h2 id="performance"> Performance</h2>
|
216
217
|
|
217
218
|
<table class="table performance">
|
@@ -241,10 +242,11 @@
|
|
241
242
|
<td><%= "%.2f" % (data[:log_size][0][0] / data[:duration]) %></td></tr>
|
242
243
|
</tbody>
|
243
244
|
</table>
|
244
|
-
|
245
|
+
</article>
|
246
|
+
</div>
|
245
247
|
</div>
|
246
|
-
</
|
247
|
-
</
|
248
|
+
</section>
|
249
|
+
</div>
|
248
250
|
</body>
|
249
251
|
</html>
|
250
252
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apache_log_report
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
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
|
+
date: 2021-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: apache_log-parser
|