apache_log_report 1.1.2 → 1.1.3

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: 07ad311b79b7ad4888250d690af4857cc620b07a4fdc7206bbc40adf5b2fd00b
4
- data.tar.gz: 1ed81f7bd6324af49a24ad6d8abe9add71710813c051537f254f80d9c9ac6739
3
+ metadata.gz: 45396921f6e594c2b2dcce25320c292c08f4bb35ab7c19dc72fb99cec8520dd4
4
+ data.tar.gz: 990dacd5e607a0f62a55f7248396ac095f2867f905807f91c3df1f6c06b5def0
5
5
  SHA512:
6
- metadata.gz: db323468d20cb50f870ac0dbe62cbfd42feb10e69da02d9d892dd206bcf9e5d1c3c5ad91a542f4f888bc04a9a6df3514ba186d67cc60b32e7647df6ff183e5d5
7
- data.tar.gz: cf33e4665e31a6f18fc346c80b6f8b7cae8456b0c9dbf2d8c658a383b3711e754f795d08963d5c3c5109bd34360c5bc00bb17c93b15e4c551a7a9a1b5f619023
6
+ metadata.gz: a1c69d138504939d0c1917c7d9f278fff974fce0c27f82c64fd45b80641070924ea5f63a17b6efb4c64c63ea54f458a8b7d3d3f3e100664c70cdc3488be78950
7
+ data.tar.gz: a675921834c7551b2b95bf983c08a71f40f94f1f16e2b24d6b4fb10c4be61f9ffd8abb9947f985f0419d1678045758934e448d7e77f4904d806f3c966b8af358
@@ -6,8 +6,8 @@ Gem::Specification.new do |spec|
6
6
  spec.authors = ["Adolfo Villafiorita"]
7
7
  spec.email = ["adolfo.villafiorita@ict4g.net"]
8
8
 
9
- spec.summary = %q{Generate a request report in OrgMode format from an Apache log file.}
10
- spec.description = %q{Generate a request report in OrgMode format from an Apache log file.}
9
+ spec.summary = %q{Generate analytics from an Apache log file.}
10
+ spec.description = %q{Generate requests reports in HTML, OrgMode, and SQLite format from an Apache log file.}
11
11
  spec.homepage = "https://www.ict4g.net/gitea/adolfo/apache_log_report"
12
12
  spec.license = "MIT"
13
13
  spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
@@ -4,7 +4,7 @@ def slugify string
4
4
  end
5
5
  %>
6
6
 
7
- <table id="<%= slugify(title || "") %>" class="<%= slugify(title || "") %>">
7
+ <table id="<%= slugify(title || "") %>" class="table <%= slugify(title || "") %>">
8
8
  <thead>
9
9
  <tr>
10
10
  <% header.each do |heading| %>
@@ -4,42 +4,76 @@
4
4
  <meta name="author" content="apache_log_report">
5
5
 
6
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">
7
11
  </head>
8
12
 
9
13
  <body>
10
- <section>
14
+ <section class="container">
11
15
  <h1>Apache Log Analysis: <%= data[:log_file] || "stdin" %></h1>
12
16
 
13
- <article>
14
- <h2>Summary</h2>
15
-
16
- <table class="pure-table summary">
17
- <tr>
18
- <th class="hits">Hits</th>
19
- <td class="hits"><%= data[:total_hits][0][0] %></td>
20
- </tr>
21
- <tr>
22
- <th class="unique-visitors">Unique Visitors</th>
23
- <td class="unique-visitors"><%= data[:total_unique_visitors][0][0] %></td>
24
- </tr>
25
- <tr>
26
- <th class="tx">Tx</th>
27
- <td class="tx"><%= data[:total_size][0][0] %></td>
28
- </tr>
29
- <tr>
30
- <th class="period">Period</th>
31
- <td class="period">
32
- <%= data[:first_day][0][0] %>
33
- --
34
- <%= data[:last_day][0][0] %>
35
- </td>
36
- </tr>
37
- <tr>
38
- <th class="days">Days </th>
39
- <td class="days"><%= data[:total_days] %></td>
40
- </tr>
41
- </table>
42
- </article>
17
+ <div class="columns">
18
+ <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>
50
+
51
+ <table class="table log-structure">
52
+ <tbody>
53
+ <tr>
54
+ <th>Input file</th>
55
+ <td><b><%= (data[:log_file] || "stdin") %></b></td>
56
+ </tr>
57
+ <tr>
58
+ <th>Log size</th>
59
+ <td><%= data[:log_size][0][0] %></td>
60
+ </tr>
61
+ <tr>
62
+ <th>Self poll entries</th>
63
+ <td><%= data[:selfpolls_size][0][0] %></td>
64
+ </tr>
65
+ <tr>
66
+ <th>Crawlers</th>
67
+ <td><%= data[:crawlers_size][0][0] %></td>
68
+ </tr>
69
+ <tr>
70
+ <th>Entries considered</th>
71
+ <td><%= data[:total_hits][0][0] %></td>
72
+ </tr>
73
+ </tbody>
74
+ </table>
75
+ </article>
76
+ </div>
43
77
 
44
78
  <% @reports = [
45
79
  { title: "Daily Distribution", header: ["Day", "Hits", "Visits", "Size"], rows: data[:daily_distribution] },
@@ -49,30 +83,37 @@
49
83
  { title: "404 on HTML Files", header: ["Path", "Hits", "Visitors"], rows: data[:missed_pages] },
50
84
  { title: "404 on other Resources", header: ["Path", "Hits", "Visitors"], rows: data[:missed_resources] },
51
85
  { title: "Attacks", header: ["Path", "Hits", "Visitors"], rows: data[:attacks] },
86
+ { },
52
87
  { title: "Statuses", header: ["Status", "Count"], rows: data[:statuses] },
53
88
  { title: "Daily Statuses", header: ["Status", "2xx", "3xx", "4xx"], rows: data[:statuses_by_day] },
54
89
  { title: "Browsers", header: ["Browser", "Hits", "Visitors", "Size"], rows: data[:browsers] },
55
90
  { title: "Platforms", header: ["Platform", "Hits", "Visitors", "Size"], rows: data[:platforms] },
91
+ { title: "Referers", header: ["Referers", "Hits", "Visitors", "Size"], rows: data[:referers], col: "col-12" },
56
92
  { title: "IPs", header: ["IPs", "Hits", "Visitors", "Size"], rows: data[:ips] },
57
- { title: "Referers", header: ["Referers", "Hits", "Visitors", "Size"], rows: data[:referers] },
93
+ { },
58
94
  ]
59
95
  %>
60
- <% @reports.each do |report| %>
61
- <article>
62
- <h2><%= report[:title] %></h2>
63
- <%= render "output_table", report %>
64
- </article>
65
- <% end %>
96
+ <div class="columns">
97
+ <% @reports.each do |report| %>
98
+ <div class="column <%= report[:col] || "col-6" %>">
99
+ <article>
100
+ <% if report[:title] != nil %>
101
+ <h2><%= report[:title] %></h2>
102
+ <%= render "output_table", report %>
103
+ <% end %>
104
+ </article>
105
+ </div>
106
+ <% end %>
107
+ </div>
66
108
 
67
109
  <article>
68
110
  <h2>Streaks</h2>
69
111
 
70
- <table class="streaks">
112
+ <table class="table streaks">
71
113
  <thead>
72
114
  <tr>
73
115
  <th>IP</th>
74
- <th>Day</th>
75
- <th>URL</th>
116
+ <th>Day and URL</th>
76
117
  </tr>
77
118
  </thead>
78
119
  <tbody>
@@ -92,105 +133,85 @@
92
133
  </table>
93
134
  </article>
94
135
 
95
- <article>
96
- <h2>Command Invocation and Performance</h2>
97
-
98
- <h3>Command Invocation</h3>
99
-
100
- <code>
101
- </code>
102
-
103
- <table class="pure-table command-invocation">
104
- <tbody>
105
- <tr>
106
- <th>CLI Command</th>
107
- <td><pre><%= data[:command] %></pre></td>
108
- </tr>
109
- <tr>
110
- <th>Input file</th>
111
- <td><code><%= (data[:log_file] || "stdin") %></code></td>
112
- </tr>
113
- <tr>
114
- <th>Ignore crawlers</th>
115
- <td><code><%= options[:ignore_crawlers] %></code></td></tr>
116
- <tr>
117
- <th>Only crawlers</th>
118
- <td><code><%= options[:only_crawlers] %></code></td>
119
- </tr>
120
- <tr>
121
- <th>No selfpoll</th>
122
- <td><code><%= options[:no_selfpoll] %></code></td>
123
- </tr>
124
- <tr>
125
- <th>Filter by date</th>
126
- <td>
127
- <code><%= (options[:from_date] != nil or options[:to_date] != nil) %></code>
128
- </td>
129
- </tr>
130
- <tr>
131
- <th>Prefix</th>
132
- <td><code><%= @prefix %></code></td>
133
- </tr>
134
- <tr>
135
- <th>Suffix</th>
136
- <td><code><%= @suffix %></code></td>
137
- </tr>
138
- </tbody>
139
- </table>
140
-
141
- <h3> Log Structure</h3>
142
-
143
- <table class="pure-table log-structure">
144
- <tbody>
145
- <tr>
146
- <th>Log size</th>
147
- <td><%= data[:log_size][0][0] %></td>
148
- </tr>
149
- <tr>
150
- <th>Self poll entries</th>
151
- <td><%= data[:selfpolls_size][0][0] %></td>
152
- </tr>
153
- <tr>
154
- <th>Crawlers</th>
155
- <td><%= data[:crawlers_size][0][0] %></td>
156
- </tr>
157
- <tr>
158
- <th>Entries considered</th>
159
- <td><%= data[:total_hits][0][0] %></td>
160
- </tr>
161
- </tbody>
162
- </table>
163
-
164
- <h3> Performance</h3>
165
-
166
- <table class="pure-table performance">
167
- <tbody>
168
- <tr>
169
- <th>Analysis started at</th>
170
- <td><%= data[:started_at].to_s %></td>
171
- </tr>
172
- <tr>
173
- <th>Analysis ended at</th>
174
- <td><%= data[:ended_at].to_s %></td>
175
- </tr>
176
- <tr>
177
- <th>Duration (sec)</th>
178
- <td><%= "%.1f" % data[:duration] %></td>
179
- </tr>
180
- <tr>
181
- <th>Duration (min)</th>
182
- <td><%= "%d" % (data[:duration] / 60 ) %></td>
183
- </tr>
184
- <tr>
185
- <th>Log size</th>
186
- <td><%= data[:log_size][0][0] %></td>
187
- </tr>
188
- <tr>
189
- <th>Lines/sec</th>
190
- <td><%= "%.2f" % (data[:log_size][0][0] / data[:duration]) %></td></tr>
191
- </tbody>
192
- </table>
193
- </article>
136
+ <div class="columns">
137
+ <div class="column col-6">
138
+ <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>
178
+ </article>
179
+ </div>
180
+
181
+ <div class="column col-6">
182
+ <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>
212
+ </article>
213
+ </div>
214
+ </div>
194
215
  </section>
195
216
  </body>
196
217
  </html>
@@ -1,3 +1,3 @@
1
1
  module ApacheLogReport
2
- VERSION = "1.1.2"
2
+ VERSION = "1.1.3"
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.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adolfo Villafiorita
@@ -66,7 +66,8 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- description: Generate a request report in OrgMode format from an Apache log file.
69
+ description: Generate requests reports in HTML, OrgMode, and SQLite format from an
70
+ Apache log file.
70
71
  email:
71
72
  - adolfo.villafiorita@ict4g.net
72
73
  executables:
@@ -121,5 +122,5 @@ requirements: []
121
122
  rubygems_version: 3.2.22
122
123
  signing_key:
123
124
  specification_version: 4
124
- summary: Generate a request report in OrgMode format from an Apache log file.
125
+ summary: Generate analytics from an Apache log file.
125
126
  test_files: []