apache_log_report 1.1.3 → 1.1.4

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: 45396921f6e594c2b2dcce25320c292c08f4bb35ab7c19dc72fb99cec8520dd4
4
- data.tar.gz: 990dacd5e607a0f62a55f7248396ac095f2867f905807f91c3df1f6c06b5def0
3
+ metadata.gz: 8b90448ec269bd64d60c2323888fb77ea8ac7307a00198434119a6f0da605585
4
+ data.tar.gz: 24569c78964b795478c50e5de01c4f42fb2be8f02c30911e4e81229a96917a55
5
5
  SHA512:
6
- metadata.gz: a1c69d138504939d0c1917c7d9f278fff974fce0c27f82c64fd45b80641070924ea5f63a17b6efb4c64c63ea54f458a8b7d3d3f3e100664c70cdc3488be78950
7
- data.tar.gz: a675921834c7551b2b95bf983c08a71f40f94f1f16e2b24d6b4fb10c4be61f9ffd8abb9947f985f0419d1678045758934e448d7e77f4904d806f3c966b8af358
6
+ metadata.gz: 604697690824080fbbed523f26c1727f969fcf791803ebd15d6838384c5c77edbcde25ad74fa47c2371c0690019745948b6d78f9f1a51e6742e51e35c5c5ba76
7
+ data.tar.gz: b7d5a6940308a6a098cb61b9118cd17760592e299e091193b07a003ae87e6f7058ee1aab81aed2cadd65dcc07c6b64652ede126274be5be552dbbf0ca3ba11b1
@@ -10,68 +10,98 @@
10
10
  <link rel="stylesheet" href="https://unpkg.com/spectre.css/dist/spectre-icons.min.css">
11
11
  </head>
12
12
 
13
- <body>
14
- <section class="container">
15
- <h1>Apache Log Analysis: <%= data[:log_file] || "stdin" %></h1>
13
+ <body class="container">
14
+ <h1>Apache Log Analysis: <%= data[:log_file] || "stdin" %></h1>
15
+
16
+ <nav>
17
+ <ul class="nav">
18
+ <li class="nav-item active">
19
+ <a href="#">Navigation</a>
20
+ <ul class="nav">
21
+ <% [ "Summary",
22
+ "Log Structure",
23
+ "Daily Distribution",
24
+ "Time Distribution",
25
+ "Most Requested Pages",
26
+ "Most Requested Resources",
27
+ "404 on HTML Files",
28
+ "404 on other Resources",
29
+ "Attacks",
30
+ "Statuses",
31
+ "Daily Statuses",
32
+ "Browsers",
33
+ "Platforms",
34
+ "Referers",
35
+ "IPs"
36
+ ].each do |item| %>
37
+ <li class="nav-item">
38
+ <a href="#<%= item.downcase.gsub(' ', '-') %>"><%= item %></a>
39
+ </li>
40
+ <% end %>
41
+ </ul>
42
+ </li>
43
+ </ul>
44
+ </nav>
16
45
 
46
+ <section>
17
47
  <div class="columns">
18
48
  <article class="col-6 column">
19
- <h2>Summary</h2>
20
-
21
- <table class="table summary">
22
- <tr>
23
- <th class="hits">Hits</th>
24
- <td class="hits"><%= data[:total_hits][0][0] %></td>
25
- </tr>
26
- <tr>
27
- <th class="unique-visitors">Unique Visitors</th>
28
- <td class="unique-visitors"><%= data[:total_unique_visitors][0][0] %></td>
29
- </tr>
30
- <tr>
31
- <th class="tx">Tx</th>
32
- <td class="tx"><%= data[:total_size][0][0] %></td>
33
- </tr>
34
- <tr>
35
- <th class="period">Period</th>
36
- <td class="period">
37
- <%= data[:first_day][0][0] %>
38
- --
39
- <%= data[:last_day][0][0] %>
40
- </td>
41
- </tr>
42
- <tr>
43
- <th class="days">Days </th>
44
- <td class="days"><%= data[:total_days] %></td>
45
- </tr>
46
- </table>
47
- </article>
48
- <article class="column col-6">
49
- <h3> Log Structure</h3>
49
+ <h2 id="summary">Summary</h2>
50
50
 
51
- <table class="table log-structure">
52
- <tbody>
51
+ <table class="table summary">
53
52
  <tr>
54
- <th>Input file</th>
55
- <td><b><%= (data[:log_file] || "stdin") %></b></td>
53
+ <th class="hits">Hits</th>
54
+ <td class="hits"><%= data[:total_hits][0][0] %></td>
56
55
  </tr>
57
56
  <tr>
58
- <th>Log size</th>
59
- <td><%= data[:log_size][0][0] %></td>
57
+ <th class="unique-visitors">Unique Visitors</th>
58
+ <td class="unique-visitors"><%= data[:total_unique_visitors][0][0] %></td>
60
59
  </tr>
61
60
  <tr>
62
- <th>Self poll entries</th>
63
- <td><%= data[:selfpolls_size][0][0] %></td>
61
+ <th class="tx">Tx</th>
62
+ <td class="tx"><%= data[:total_size][0][0] %></td>
64
63
  </tr>
65
64
  <tr>
66
- <th>Crawlers</th>
67
- <td><%= data[:crawlers_size][0][0] %></td>
65
+ <th class="period">Period</th>
66
+ <td class="period">
67
+ <%= data[:first_day][0][0] %>
68
+ --
69
+ <%= data[:last_day][0][0] %>
70
+ </td>
68
71
  </tr>
69
72
  <tr>
70
- <th>Entries considered</th>
71
- <td><%= data[:total_hits][0][0] %></td>
73
+ <th class="days">Days </th>
74
+ <td class="days"><%= data[:total_days] %></td>
72
75
  </tr>
73
- </tbody>
74
- </table>
76
+ </table>
77
+ </article>
78
+ <article class="column col-6">
79
+ <h2 id="log-structure">Log Structure</h2>
80
+
81
+ <table class="table log-structure">
82
+ <tbody>
83
+ <tr>
84
+ <th>Input file</th>
85
+ <td><b><%= (data[:log_file] || "stdin") %></b></td>
86
+ </tr>
87
+ <tr>
88
+ <th>Log size</th>
89
+ <td><%= data[:log_size][0][0] %></td>
90
+ </tr>
91
+ <tr>
92
+ <th>Self poll entries</th>
93
+ <td><%= data[:selfpolls_size][0][0] %></td>
94
+ </tr>
95
+ <tr>
96
+ <th>Crawlers</th>
97
+ <td><%= data[:crawlers_size][0][0] %></td>
98
+ </tr>
99
+ <tr>
100
+ <th>Entries considered</th>
101
+ <td><%= data[:total_hits][0][0] %></td>
102
+ </tr>
103
+ </tbody>
104
+ </table>
75
105
  </article>
76
106
  </div>
77
107
 
@@ -98,7 +128,9 @@
98
128
  <div class="column <%= report[:col] || "col-6" %>">
99
129
  <article>
100
130
  <% if report[:title] != nil %>
101
- <h2><%= report[:title] %></h2>
131
+ <h2 id="<%= report[:title].downcase.gsub(/ +/, '-') %>">
132
+ <%= report[:title] %>
133
+ </h2>
102
134
  <%= render "output_table", report %>
103
135
  <% end %>
104
136
  </article>
@@ -107,108 +139,108 @@
107
139
  </div>
108
140
 
109
141
  <article>
110
- <h2>Streaks</h2>
111
-
112
- <table class="table streaks">
113
- <thead>
114
- <tr>
115
- <th>IP</th>
116
- <th>Day and URL</th>
117
- </tr>
118
- </thead>
119
- <tbody>
120
- <% data[:streaks].group_by(&:first).each do |ip, date_urls| %>
142
+ <h2 id="streaks">Streaks</h2>
143
+
144
+ <table class="table streaks">
145
+ <thead>
121
146
  <tr>
122
- <td class="ip"><%= ip %></td>
123
- <td class="streaks">
124
- <% date_urls.group_by(&:first).each do |date, urls| %>
125
- <% urls.each do |url| %>
126
- <b><%= url[1] %>:</b> <%= url[2] %> <br />
127
- <% end %>
128
- <% end %>
129
- </td>
147
+ <th>IP</th>
148
+ <th>Day and URL</th>
130
149
  </tr>
131
- <% end %>
132
- </tbody>
133
- </table>
134
- </article>
150
+ </thead>
151
+ <tbody>
152
+ <% data[:streaks].group_by(&:first).each do |ip, date_urls| %>
153
+ <tr>
154
+ <td class="ip"><%= ip %></td>
155
+ <td class="streaks">
156
+ <% date_urls.group_by(&:first).each do |date, urls| %>
157
+ <% urls.each do |url| %>
158
+ <b><%= url[1] %>:</b> <%= url[2] %> <br />
159
+ <% end %>
160
+ <% end %>
161
+ </td>
162
+ </tr>
163
+ <% end %>
164
+ </tbody>
165
+ </table>
166
+ </article>
135
167
 
136
168
  <div class="columns">
137
169
  <div class="column col-6">
138
170
  <article>
139
- <h2>Command Invocation</h2>
140
-
141
- <table class="table command-invocation">
142
- <tbody>
143
- <tr>
144
- <th>CLI Command</th>
145
- <td><pre><%= data[:command] %></pre></td>
146
- </tr>
147
- <tr>
148
- <th>Input file</th>
149
- <td><code><%= (data[:log_file] || "stdin") %></code></td>
150
- </tr>
151
- <tr>
152
- <th>Ignore crawlers</th>
153
- <td><code><%= options[:ignore_crawlers] %></code></td></tr>
154
- <tr>
155
- <th>Only crawlers</th>
156
- <td><code><%= options[:only_crawlers] %></code></td>
157
- </tr>
158
- <tr>
159
- <th>No selfpoll</th>
160
- <td><code><%= options[:no_selfpoll] %></code></td>
161
- </tr>
162
- <tr>
163
- <th>Filter by date</th>
164
- <td>
165
- <code><%= (options[:from_date] != nil or options[:to_date] != nil) %></code>
166
- </td>
167
- </tr>
168
- <tr>
169
- <th>Prefix</th>
170
- <td><code><%= @prefix %></code></td>
171
- </tr>
172
- <tr>
173
- <th>Suffix</th>
174
- <td><code><%= @suffix %></code></td>
175
- </tr>
176
- </tbody>
177
- </table>
171
+ <h2 id="command-invocation">Command Invocation</h2>
172
+
173
+ <table class="table command-invocation">
174
+ <tbody>
175
+ <tr>
176
+ <th>CLI Command</th>
177
+ <td><pre><%= data[:command] %></pre></td>
178
+ </tr>
179
+ <tr>
180
+ <th>Input file</th>
181
+ <td><code><%= (data[:log_file] || "stdin") %></code></td>
182
+ </tr>
183
+ <tr>
184
+ <th>Ignore crawlers</th>
185
+ <td><code><%= options[:ignore_crawlers] %></code></td></tr>
186
+ <tr>
187
+ <th>Only crawlers</th>
188
+ <td><code><%= options[:only_crawlers] %></code></td>
189
+ </tr>
190
+ <tr>
191
+ <th>No selfpoll</th>
192
+ <td><code><%= options[:no_selfpoll] %></code></td>
193
+ </tr>
194
+ <tr>
195
+ <th>Filter by date</th>
196
+ <td>
197
+ <code><%= (options[:from_date] != nil or options[:to_date] != nil) %></code>
198
+ </td>
199
+ </tr>
200
+ <tr>
201
+ <th>Prefix</th>
202
+ <td><code><%= @prefix %></code></td>
203
+ </tr>
204
+ <tr>
205
+ <th>Suffix</th>
206
+ <td><code><%= @suffix %></code></td>
207
+ </tr>
208
+ </tbody>
209
+ </table>
178
210
  </article>
179
211
  </div>
180
212
 
181
213
  <div class="column col-6">
182
214
  <article>
183
- <h2> Performance</h2>
184
-
185
- <table class="table performance">
186
- <tbody>
187
- <tr>
188
- <th>Analysis started at</th>
189
- <td><%= data[:started_at].to_s %></td>
190
- </tr>
191
- <tr>
192
- <th>Analysis ended at</th>
193
- <td><%= data[:ended_at].to_s %></td>
194
- </tr>
195
- <tr>
196
- <th>Duration (sec)</th>
197
- <td><%= "%.1f" % data[:duration] %></td>
198
- </tr>
199
- <tr>
200
- <th>Duration (min)</th>
201
- <td><%= "%d" % (data[:duration] / 60 ) %></td>
202
- </tr>
203
- <tr>
204
- <th>Log size</th>
205
- <td><%= data[:log_size][0][0] %></td>
206
- </tr>
207
- <tr>
208
- <th>Lines/sec</th>
209
- <td><%= "%.2f" % (data[:log_size][0][0] / data[:duration]) %></td></tr>
210
- </tbody>
211
- </table>
215
+ <h2 id="performance"> Performance</h2>
216
+
217
+ <table class="table performance">
218
+ <tbody>
219
+ <tr>
220
+ <th>Analysis started at</th>
221
+ <td><%= data[:started_at].to_s %></td>
222
+ </tr>
223
+ <tr>
224
+ <th>Analysis ended at</th>
225
+ <td><%= data[:ended_at].to_s %></td>
226
+ </tr>
227
+ <tr>
228
+ <th>Duration (sec)</th>
229
+ <td><%= "%.1f" % data[:duration] %></td>
230
+ </tr>
231
+ <tr>
232
+ <th>Duration (min)</th>
233
+ <td><%= "%d" % (data[:duration] / 60 ) %></td>
234
+ </tr>
235
+ <tr>
236
+ <th>Log size</th>
237
+ <td><%= data[:log_size][0][0] %></td>
238
+ </tr>
239
+ <tr>
240
+ <th>Lines/sec</th>
241
+ <td><%= "%.2f" % (data[:log_size][0][0] / data[:duration]) %></td></tr>
242
+ </tbody>
243
+ </table>
212
244
  </article>
213
245
  </div>
214
246
  </div>
@@ -1,3 +1,3 @@
1
1
  module ApacheLogReport
2
- VERSION = "1.1.3"
2
+ VERSION = "1.1.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apache_log_report
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adolfo Villafiorita