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
@@ -1,328 +1,245 @@
|
|
1
|
-
|
1
|
+
<!doctype html>
|
2
|
+
<html class="no-js" lang="en">
|
2
3
|
<head>
|
3
|
-
<title>
|
4
|
-
|
4
|
+
<title>Log Sense: <%= data[:log_file] %></title>
|
5
|
+
|
6
|
+
<meta charset="utf-8" />
|
7
|
+
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
9
|
+
<meta name="author" content="Log Sense">
|
10
|
+
<meta name="description" content="Analysis of <%= data[:log_file] %>">
|
11
|
+
|
12
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/foundation-icons.min.css">
|
13
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/foundation-sites@6.7.4/dist/css/foundation.min.css">
|
14
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/zf/dt-1.11.3/datatables.min.css"/>
|
15
|
+
|
16
|
+
<style>
|
17
|
+
#offCanvas {
|
18
|
+
color: white;
|
19
|
+
background: #333333;
|
20
|
+
border-right: ;
|
21
|
+
box-shadow: none;
|
22
|
+
padding: 0.5rem;
|
23
|
+
}
|
24
|
+
#offCanvas a {
|
25
|
+
color: orange;
|
26
|
+
}
|
27
|
+
|
28
|
+
.contents-button {
|
29
|
+
font-size: xx-large;
|
30
|
+
}
|
31
|
+
|
32
|
+
.main-section {
|
33
|
+
margin-left: 45px;
|
34
|
+
}
|
35
|
+
|
36
|
+
</style>
|
5
37
|
|
6
|
-
<link rel="stylesheet" href="alr-styles.css"></style>
|
7
|
-
|
8
|
-
<link rel="stylesheet" href="https://unpkg.com/spectre.css/dist/spectre.min.css">
|
9
|
-
<link rel="stylesheet" href="https://unpkg.com/spectre.css/dist/spectre-exp.min.css">
|
10
|
-
<link rel="stylesheet" href="https://unpkg.com/spectre.css/dist/spectre-icons.min.css">
|
11
38
|
</head>
|
12
39
|
|
13
40
|
<body>
|
14
|
-
<div class="
|
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
|
-
|
41
|
+
<div class="off-canvas-wrapper">
|
42
|
+
<div class="off-canvas position-left" id="offCanvas" data-off-canvas>
|
43
|
+
<nav>
|
44
|
+
<h2>Navigation</h2>
|
45
|
+
<ul class="no-bullet">
|
46
|
+
<% [ "Summary",
|
47
|
+
"Log Structure",
|
48
|
+
"Daily Distribution",
|
49
|
+
"Time Distribution",
|
50
|
+
"Most Requested Pages",
|
51
|
+
"Most Requested Resources",
|
52
|
+
"404 on HTML Files",
|
53
|
+
"404 on other Resources",
|
54
|
+
"Attacks",
|
55
|
+
"Statuses",
|
56
|
+
"Daily Statuses",
|
57
|
+
"Browsers",
|
58
|
+
"Platforms",
|
59
|
+
"Referers",
|
60
|
+
"IPs",
|
61
|
+
"Geolocation",
|
62
|
+
"Streaks",
|
63
|
+
"Command Invocation",
|
64
|
+
"Performance"
|
65
|
+
].each do |item| %>
|
66
|
+
<li class="nav-item">
|
67
|
+
<a href="#<%= item.downcase.gsub(' ', '-') %>" data-close><%= item %></a>
|
68
|
+
</li>
|
69
|
+
<% end %>
|
70
|
+
</ul>
|
71
|
+
|
72
|
+
<p>
|
73
|
+
Generated by
|
74
|
+
<a href="https://github.com/avillafiorita/log_sense">LogSense</a> <br />
|
75
|
+
on <%= DateTime.now.strftime("%Y-%m-%d %H:%M") %>.<br />
|
76
|
+
<a href='https://db-ip.com'>IP Geolocation by DB-IP</a>
|
77
|
+
</p>
|
78
|
+
</nav>
|
79
|
+
</div>
|
80
|
+
<div class="off-canvas-content grid-container grid-x fluid" data-off-canvas-content>
|
81
|
+
<div data-sticky-container>
|
82
|
+
<div class="sticky" data-sticky data-margin-top="0">
|
83
|
+
<div class="contents-button">
|
84
|
+
<i id="hamburger" class="fi-list" data-toggle="offCanvas"></i>
|
85
|
+
</div>
|
86
|
+
</div>
|
87
|
+
</div>
|
54
88
|
|
55
|
-
|
56
|
-
|
89
|
+
<section class="main-section">
|
90
|
+
<h1>Apache Log Analysis: <%= data[:log_file] || "stdin" %></h1>
|
57
91
|
|
58
|
-
|
59
|
-
|
60
|
-
|
92
|
+
<div class="grid-x grid-margin-x">
|
93
|
+
<article class="small-12 large-6 cell">
|
94
|
+
<h2 id="summary">Summary</h2>
|
95
|
+
<%= render "summary.html.erb", data: data %>
|
96
|
+
</article>
|
61
97
|
|
62
|
-
<
|
63
|
-
<
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
<tr>
|
68
|
-
<th class="period">Period Analyzed</th>
|
69
|
-
<td class="period">
|
70
|
-
<%= data[:first_day_in_analysis] %>
|
71
|
-
--
|
72
|
-
<%= data[:last_day_in_analysis] %>
|
73
|
-
</td>
|
74
|
-
</tr>
|
75
|
-
<tr>
|
76
|
-
<th class="days">Days </th>
|
77
|
-
<td class="days"><%= data[:total_days_in_analysis] %></td>
|
78
|
-
</tr>
|
79
|
-
<tr>
|
80
|
-
<th class="hits">Hits</th>
|
81
|
-
<td class="hits"><%= data[:total_hits][0][0] %></td>
|
82
|
-
</tr>
|
83
|
-
<tr>
|
84
|
-
<th class="unique-visitors">Unique Visitors</th>
|
85
|
-
<td class="unique-visitors"><%= data[:total_unique_visitors][0][0] %></td>
|
86
|
-
</tr>
|
87
|
-
<tr>
|
88
|
-
<th class="tx">Tx</th>
|
89
|
-
<td class="tx"><%= data[:total_size][0][0] %></td>
|
90
|
-
</tr>
|
91
|
-
</table>
|
92
|
-
</article>
|
93
|
-
<article class="column col-6">
|
94
|
-
<h2 id="log-structure">Log Structure</h2>
|
98
|
+
<article class="cell small-12 large-6">
|
99
|
+
<h2 id="log-structure">Log Structure</h2>
|
100
|
+
<%= render "total_hits.html.erb", data: data %>
|
101
|
+
</article>
|
102
|
+
</div>
|
95
103
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
</
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
104
|
+
<% @reports = [
|
105
|
+
{ title: "Daily Distribution", header: ["Day", "DOW", "Hits", "Visits", "Size"], rows: data[:daily_distribution] },
|
106
|
+
{ title: "Time Distribution", header: ["Hour", "Hits", "Visits", "Size"], rows: data[:time_distribution] },
|
107
|
+
{ title: "Most Requested Pages", header: ["Path", "Hits", "Visits", "Size"], rows: data[:most_requested_pages] },
|
108
|
+
{ title: "Most Requested Resources", header: ["Path", "Hits", "Visits", "Size"], rows: data[:most_requested_resources] },
|
109
|
+
{ title: "404 on HTML Files", header: ["Path", "Hits", "Visits"], rows: data[:missed_pages] },
|
110
|
+
{ title: "404 on other Resources", header: ["Path", "Hits", "Visits"], rows: data[:missed_resources] },
|
111
|
+
{ title: "Attacks", header: ["Path", "Hits", "Visits"], rows: data[:attacks] },
|
112
|
+
{ title: "Statuses", header: ["Status", "Count"], rows: data[:statuses] },
|
113
|
+
{ title: "Daily Statuses", header: ["Status", "2xx", "3xx", "4xx"], rows: data[:statuses_by_day] },
|
114
|
+
{ title: "Browsers", header: ["Browser", "Hits", "Visits", "Size"], rows: data[:browsers] },
|
115
|
+
{ title: "Platforms", header: ["Platform", "Hits", "Visits", "Size"], rows: data[:platforms] },
|
116
|
+
{ title: "Referers", header: ["Referers", "Hits", "Visits", "Size"], rows: data[:referers], col: "col-12" },
|
117
|
+
{ title: "IPs", header: ["IPs", "Hits", "Visits", "Size", "Country"], rows: data[:ips] },
|
118
|
+
]
|
119
|
+
%>
|
120
|
+
<div class="grid-x grid-margin-x">
|
121
|
+
<% @reports.each do |report| %>
|
122
|
+
<article class="cell <%= report[:col] || "small-12 large-6" %>" >
|
123
|
+
<h2 id="<%= report[:title].downcase.gsub(/ +/, '-') %>">
|
124
|
+
<%= report[:title] %>
|
125
|
+
</h2>
|
126
|
+
<%= render "output_table.html.erb", report %>
|
127
|
+
</article>
|
128
|
+
<% end %>
|
129
|
+
</div>
|
130
|
+
|
131
|
+
<article>
|
132
|
+
<h2 id="geolocation">Geolocation</h2>
|
133
|
+
<table id="geolocation-table" class="table unstriped">
|
134
|
+
<thead>
|
122
135
|
<tr>
|
123
|
-
<th>
|
124
|
-
<
|
125
|
-
|
136
|
+
<th>Country Code</th>
|
137
|
+
<th>Total Hits</th>
|
138
|
+
<th>Total Visits</th>
|
139
|
+
<th>IPs</th>
|
140
|
+
</tr>
|
141
|
+
</thead>
|
142
|
+
<tbody>
|
143
|
+
<%# IP, Hits, Visits Size, Country%>
|
144
|
+
<% data[:ips].group_by { |x| x[4] }.each do |k, v| %>
|
145
|
+
<tr>
|
146
|
+
<td><%= k %></td>
|
147
|
+
<td><%= v.map { |x| x[1] }.inject(&:+) %></td>
|
148
|
+
<td><%= v.map { |x| x[2] }.inject(&:+) %></td>
|
149
|
+
<td><%= v.map { |x| x[0] }.join(", ") %></td>
|
150
|
+
</tr>
|
151
|
+
<% end %>
|
126
152
|
</tbody>
|
127
153
|
</table>
|
128
154
|
</article>
|
129
|
-
</div>
|
130
|
-
|
131
|
-
<% @reports = [
|
132
|
-
{ title: "Daily Distribution", header: ["Day", "DOW", "Hits", "Visits", "Size"], rows: data[:daily_distribution] },
|
133
|
-
{ title: "Time Distribution", header: ["Hour", "Hits", "Visits", "Size"], rows: data[:time_distribution] },
|
134
|
-
{ title: "Most Requested Pages", header: ["Path", "Hits", "Visits", "Size"], rows: data[:most_requested_pages] },
|
135
|
-
{ title: "Most Requested Resources", header: ["Path", "Hits", "Visits", "Size"], rows: data[:most_requested_resources] },
|
136
|
-
{ title: "404 on HTML Files", header: ["Path", "Hits", "Visitors"], rows: data[:missed_pages] },
|
137
|
-
{ title: "404 on other Resources", header: ["Path", "Hits", "Visitors"], rows: data[:missed_resources] },
|
138
|
-
{ title: "Attacks", header: ["Path", "Hits", "Visitors"], rows: data[:attacks] },
|
139
|
-
{ },
|
140
|
-
{ title: "Statuses", header: ["Status", "Count"], rows: data[:statuses] },
|
141
|
-
{ title: "Daily Statuses", header: ["Status", "2xx", "3xx", "4xx"], rows: data[:statuses_by_day] },
|
142
|
-
{ title: "Browsers", header: ["Browser", "Hits", "Visitors", "Size"], rows: data[:browsers] },
|
143
|
-
{ title: "Platforms", header: ["Platform", "Hits", "Visitors", "Size"], rows: data[:platforms] },
|
144
|
-
{ title: "Referers", header: ["Referers", "Hits", "Visitors", "Size"], rows: data[:referers], col: "col-12" },
|
145
|
-
{ title: "IPs", header: ["IPs", "Hits", "Visitors", "Size", "Country"], rows: data[:ips] },
|
146
|
-
{ },
|
147
|
-
]
|
148
|
-
%>
|
149
|
-
<div class="columns">
|
150
|
-
<% @reports.each do |report| %>
|
151
|
-
<div class="column <%= report[:col] || "col-6" %>">
|
152
|
-
<article>
|
153
|
-
<% if report[:title] != nil %>
|
154
|
-
<h2 id="<%= report[:title].downcase.gsub(/ +/, '-') %>">
|
155
|
-
<%= report[:title] %>
|
156
|
-
</h2>
|
157
|
-
<%= render "output_table", report %>
|
158
|
-
<% end %>
|
159
|
-
</article>
|
160
|
-
</div>
|
161
|
-
<% end %>
|
162
|
-
</div>
|
163
|
-
|
164
|
-
<article>
|
165
|
-
<h2 id="geolocation">Geolocation</h2>
|
166
|
-
<table class="table">
|
167
|
-
<thead>
|
168
|
-
<tr>
|
169
|
-
<th>Country Code</th>
|
170
|
-
<th>Total Hits</th>
|
171
|
-
<th>Total Visitors</th>
|
172
|
-
<th>IPs</th>
|
173
|
-
</tr>
|
174
|
-
</thead>
|
175
|
-
<tbody>
|
176
|
-
<%# IP, Hits, Visitors Size, Country%>
|
177
|
-
<% data[:ips].group_by { |x| x[4] }.each do |k, v| %>
|
178
|
-
<tr>
|
179
|
-
<td><%= k %></td>
|
180
|
-
<td><%= v.map { |x| x[1] }.inject(&:+) %></td>
|
181
|
-
<td><%= v.map { |x| x[2] }.inject(&:+) %></td>
|
182
|
-
<td><%= v.map { |x| x[0] }.join(", ") %></td>
|
183
|
-
</tr>
|
184
|
-
<% end %>
|
185
|
-
</tbody>
|
186
|
-
</table>
|
187
|
-
</article>
|
188
155
|
|
189
|
-
|
190
|
-
|
156
|
+
<article>
|
157
|
+
<h2 id="streaks">Streaks</h2>
|
191
158
|
|
192
|
-
|
193
|
-
|
194
|
-
<tr>
|
195
|
-
<th>IP</th>
|
196
|
-
<th>
|
197
|
-
<div class="columns">
|
198
|
-
<div class="col-2 column">
|
199
|
-
Day
|
200
|
-
</div>
|
201
|
-
<div class="col-10 column">
|
202
|
-
Resources
|
203
|
-
</div>
|
204
|
-
</div>
|
205
|
-
</th>
|
206
|
-
</tr>
|
207
|
-
</thead>
|
208
|
-
<tbody>
|
209
|
-
<% data[:streaks].group_by(&:first).each do |ip, date_urls| %>
|
159
|
+
<table id="streaks-table" class="table data-table streaks">
|
160
|
+
<thead>
|
210
161
|
<tr>
|
211
|
-
<
|
212
|
-
<
|
213
|
-
<div class="
|
214
|
-
|
215
|
-
|
216
|
-
<%= date %>
|
162
|
+
<th>IP</th>
|
163
|
+
<th>
|
164
|
+
<div class="grid-x grid-margin-x">
|
165
|
+
<div class="col-2 cell">
|
166
|
+
Day
|
217
167
|
</div>
|
218
|
-
<div class="col-10
|
219
|
-
|
220
|
-
<ul>
|
221
|
-
<% urls.map { |x| x[2] }.compact.select { |x| x.match /.*\.html?/ }.each do |url| %>
|
222
|
-
<li><%= url %></li>
|
223
|
-
<% end %>
|
224
|
-
</ul>
|
225
|
-
|
226
|
-
<span class="res-title">Other Resources:</span>
|
227
|
-
<ul>
|
228
|
-
<% urls.map { |x| x[2] }.compact.sort.select { |x| x and not x.match /.*\.html?/ }.each do |url| %>
|
229
|
-
<li><%= url %></li>
|
230
|
-
<% end %>
|
231
|
-
</ul>
|
168
|
+
<div class="col-10 cell">
|
169
|
+
Resources
|
232
170
|
</div>
|
233
|
-
<% end %>
|
234
171
|
</div>
|
235
|
-
</
|
172
|
+
</th>
|
236
173
|
</tr>
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
</article>
|
241
|
-
|
242
|
-
<div class="columns">
|
243
|
-
<div class="column col-6">
|
244
|
-
<article>
|
245
|
-
<h2 id="command-invocation">Command Invocation</h2>
|
246
|
-
|
247
|
-
<table class="table command-invocation">
|
248
|
-
<tbody>
|
249
|
-
<tr>
|
250
|
-
<th>CLI Command</th>
|
251
|
-
<td><code><%= data[:command] %></code></td>
|
252
|
-
</tr>
|
253
|
-
<tr>
|
254
|
-
<th>Input file</th>
|
255
|
-
<td><code><%= (data[:log_file] || "stdin") %></code></td>
|
256
|
-
</tr>
|
257
|
-
<tr>
|
258
|
-
<th>Ignore crawlers</th>
|
259
|
-
<td><code><%= options[:ignore_crawlers] %></code></td></tr>
|
260
|
-
<tr>
|
261
|
-
<th>Only crawlers</th>
|
262
|
-
<td><code><%= options[:only_crawlers] %></code></td>
|
263
|
-
</tr>
|
264
|
-
<tr>
|
265
|
-
<th>No selfpoll</th>
|
266
|
-
<td><code><%= options[:no_selfpoll] %></code></td>
|
267
|
-
</tr>
|
174
|
+
</thead>
|
175
|
+
<tbody>
|
176
|
+
<% data[:streaks].group_by(&:first).each do |ip, date_urls| %>
|
268
177
|
<tr>
|
269
|
-
<
|
270
|
-
<td>
|
271
|
-
<
|
178
|
+
<td class="ip"><%= ip %></td>
|
179
|
+
<td class="streaks">
|
180
|
+
<div class="grid-x grid-margin-x">
|
181
|
+
<% date_urls.group_by { |x| x[1] }.each do |date, urls| %>
|
182
|
+
<div class="col-2 cell">
|
183
|
+
<%= date %>
|
184
|
+
</div>
|
185
|
+
<div class="col-10 cell">
|
186
|
+
<span class="res-title">HTML:</span>
|
187
|
+
<ul>
|
188
|
+
<% urls.map { |x| x[2] }.compact.select { |x| x.match /.*\.html?/ }.each do |url| %>
|
189
|
+
<li><%= url %></li>
|
190
|
+
<% end %>
|
191
|
+
</ul>
|
192
|
+
|
193
|
+
<span class="res-title">Other Resources:</span>
|
194
|
+
<ul>
|
195
|
+
<% urls.map { |x| x[2] }.compact.sort.select { |x| x and not x.match /.*\.html?/ }.each do |url| %>
|
196
|
+
<li><%= url %></li>
|
197
|
+
<% end %>
|
198
|
+
</ul>
|
199
|
+
</div>
|
200
|
+
<% end %>
|
201
|
+
</div>
|
272
202
|
</td>
|
273
203
|
</tr>
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
<tr>
|
279
|
-
<th>Suffix</th>
|
280
|
-
<td><code><%= @suffix %></code></td>
|
281
|
-
</tr>
|
282
|
-
</tbody>
|
283
|
-
</table>
|
284
|
-
</article>
|
285
|
-
</div>
|
204
|
+
<% end %>
|
205
|
+
</tbody>
|
206
|
+
</table>
|
207
|
+
</article>
|
286
208
|
|
287
|
-
<div class="
|
288
|
-
<
|
289
|
-
<
|
209
|
+
<div class="grid-x grid-margin-x">
|
210
|
+
<div class="cell small-12 large-6">
|
211
|
+
<article>
|
212
|
+
<h2 id="command-invocation">Command Invocation</h2>
|
290
213
|
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
<th>Duration (sec)</th>
|
303
|
-
<td><%= "%.1f" % data[:duration] %></td>
|
304
|
-
</tr>
|
305
|
-
<tr>
|
306
|
-
<th>Duration (min)</th>
|
307
|
-
<td><%= "%d" % (data[:duration] / 60 ) %></td>
|
308
|
-
</tr>
|
309
|
-
<tr>
|
310
|
-
<th>Log size</th>
|
311
|
-
<td><%= data[:log_size][0][0] %></td>
|
312
|
-
</tr>
|
313
|
-
<tr>
|
314
|
-
<th>Lines/sec</th>
|
315
|
-
<td><%= "%.2f" % (data[:log_size][0][0] / data[:duration]) %></td></tr>
|
316
|
-
</tbody>
|
317
|
-
</table>
|
318
|
-
</article>
|
214
|
+
<%= render "command_invocation.html.erb", data: data, options: options %>
|
215
|
+
</article>
|
216
|
+
</div>
|
217
|
+
|
218
|
+
<div class="small-12 large-6 cell">
|
219
|
+
<article>
|
220
|
+
<h2 id="performance"> Performance</h2>
|
221
|
+
|
222
|
+
<%= render "performance.html.erb", data: data %>
|
223
|
+
</article>
|
224
|
+
</div>
|
319
225
|
</div>
|
320
|
-
</
|
321
|
-
</
|
226
|
+
</section>
|
227
|
+
</div>
|
228
|
+
|
229
|
+
<script type="text/javascript" src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
230
|
+
<script type="text/javascript" src="js/vendor/what-input.js"></script>
|
231
|
+
<script type="text/javascript" src="https://cdn.datatables.net/v/zf/dt-1.11.3/datatables.min.js"></script>
|
232
|
+
<script src="https://cdn.jsdelivr.net/npm/vega@5"></script>
|
233
|
+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/foundation-sites@6.7.4/dist/js/foundation.min.js" crossorigin="anonymous"></script>
|
234
|
+
<script>
|
235
|
+
$(document).foundation();
|
236
|
+
|
237
|
+
$(document).ready(function () {
|
238
|
+
$('.data-table').each(function () {
|
239
|
+
$(this).DataTable();
|
240
|
+
});
|
241
|
+
});
|
242
|
+
</script>
|
322
243
|
</div>
|
323
244
|
</body>
|
324
245
|
</html>
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
@@ -1,9 +1,8 @@
|
|
1
|
-
Rails Log Analysis
|
1
|
+
* Rails Log Analysis
|
2
2
|
|
3
|
-
<%= data
|
4
|
-
|
5
|
-
|
6
|
-
<%= data[:events] %>
|
3
|
+
<%= render "summary.txt.erb", data: data %>
|
4
|
+
|
5
|
+
** Access by Day
|
7
6
|
|
8
7
|
<%=
|
9
8
|
table = Terminal::Table.new headings: ['Date', 'Day', 'Events'], rows: @data[:daily_distribution]
|
@@ -11,29 +10,51 @@ table.align_column(3, :right)
|
|
11
10
|
table
|
12
11
|
%>
|
13
12
|
|
13
|
+
** Access by Time
|
14
|
+
|
14
15
|
<%=
|
15
16
|
table = Terminal::Table.new headings: ['Hour', 'Events'], rows: @data[:time_distribution]
|
16
17
|
table.align_column(2, :right)
|
17
18
|
table
|
18
19
|
%>
|
19
20
|
|
21
|
+
** Statuses
|
22
|
+
|
20
23
|
<%=
|
21
24
|
table = Terminal::Table.new headings: ['Status', 'Events'], rows: @data[:statuses]
|
22
25
|
table.align_column(2, :right)
|
23
26
|
table
|
24
27
|
%>
|
25
28
|
|
29
|
+
** IP and Country
|
30
|
+
|
26
31
|
<%=
|
27
|
-
table = Terminal::Table.new headings: ['IP', 'Events'], rows: @data[:ips]
|
28
|
-
table.align_column(
|
32
|
+
table = Terminal::Table.new headings: ['IP', 'Events', 'Country'], rows: @data[:ips]
|
33
|
+
table.align_column(1, :right)
|
29
34
|
table
|
30
35
|
%>
|
31
36
|
|
37
|
+
** Rails Performance
|
38
|
+
|
32
39
|
<%= table = Terminal::Table.new headings: ['Controller', 'Hits', 'Min', 'Avg', 'Max'], rows: @data[:performance]
|
40
|
+
table.align_column(1, :right)
|
33
41
|
table.align_column(2, :right)
|
34
42
|
table.align_column(3, :right)
|
35
43
|
table.align_column(4, :right)
|
36
44
|
table
|
37
45
|
%>
|
38
46
|
|
47
|
+
** Fatal Events
|
48
|
+
|
49
|
+
<%= table = Terminal::Table.new headings: ['Date', 'IP', 'URL', 'Log ID'], rows: @data[:fatal]
|
50
|
+
table
|
51
|
+
%>
|
52
|
+
|
53
|
+
** Command Invocation
|
54
|
+
|
55
|
+
<%= render "command_invocation.txt.erb", data: data %>
|
56
|
+
|
57
|
+
** Log Sense Performance
|
58
|
+
|
59
|
+
<%= render "performance.txt.erb", data: data %>
|
39
60
|
|
data/lib/log_sense/version.rb
CHANGED
File without changes
|