apache_log_report 1.1.1 → 1.1.2
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/Gemfile.lock +1 -1
- data/README.org +2 -4
- data/exe/apache_log_report +24 -17
- data/lib/apache_log_report/data_cruncher.rb +2 -0
- data/lib/apache_log_report/options_parser.rb +1 -1
- data/lib/apache_log_report/templates/template.html.erb +37 -1
- data/lib/apache_log_report/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07ad311b79b7ad4888250d690af4857cc620b07a4fdc7206bbc40adf5b2fd00b
|
4
|
+
data.tar.gz: 1ed81f7bd6324af49a24ad6d8abe9add71710813c051537f254f80d9c9ac6739
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db323468d20cb50f870ac0dbe62cbfd42feb10e69da02d9d892dd206bcf9e5d1c3c5ad91a542f4f888bc04a9a6df3514ba186d67cc60b32e7647df6ff183e5d5
|
7
|
+
data.tar.gz: cf33e4665e31a6f18fc346c80b6f8b7cae8456b0c9dbf2d8c658a383b3711e754f795d08963d5c3c5109bd34360c5bc00bb17c93b15e4c551a7a9a1b5f619023
|
data/Gemfile.lock
CHANGED
data/README.org
CHANGED
@@ -14,10 +14,8 @@ See the [[file:CHANGELOG.org][CHANGELOG]] file.
|
|
14
14
|
|
15
15
|
* Todo
|
16
16
|
|
17
|
-
** TODO
|
18
|
-
** TODO
|
19
|
-
** TODO Move performance stats var to class (to isolate vars)
|
20
|
-
** TODO Check total number of days (which is not working, now)
|
17
|
+
** TODO Graphs in HTML output
|
18
|
+
** TODO Countries
|
21
19
|
|
22
20
|
* Compatibility
|
23
21
|
|
data/exe/apache_log_report
CHANGED
@@ -23,21 +23,28 @@ end
|
|
23
23
|
@started_at = Time.now
|
24
24
|
|
25
25
|
@db = ApacheLogReport::LogParser.parse @log_file
|
26
|
-
@data = ApacheLogReport::DataCruncher.crunch @db, @options
|
27
26
|
|
28
|
-
@
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
27
|
+
if @options[:output_format] == "sqlite"
|
28
|
+
ddb = SQLite3::Database.new('db.sqlite3')
|
29
|
+
b = SQLite3::Backup.new(ddb, 'main', @db, 'main')
|
30
|
+
b.step(-1) #=> DONE
|
31
|
+
b.finish
|
32
|
+
else
|
33
|
+
@data = ApacheLogReport::DataCruncher.crunch @db, @options
|
34
|
+
|
35
|
+
@ended_at = Time.now
|
36
|
+
@duration = @ended_at - @started_at
|
37
|
+
|
38
|
+
@data = @data.merge({
|
39
|
+
command: @command,
|
40
|
+
log_file: @log_file,
|
41
|
+
started_at: @started_at,
|
42
|
+
ended_at: @ended_at,
|
43
|
+
duration: @duration
|
44
|
+
})
|
45
|
+
|
46
|
+
#
|
47
|
+
# Emit Output
|
48
|
+
#
|
49
|
+
puts ApacheLogReport::Emitter.emit @data, @options
|
50
|
+
end
|
@@ -71,6 +71,8 @@ module ApacheLogReport
|
|
71
71
|
@ips = db.execute "SELECT ip, count(ip), count(distinct(unique_visitor)), #{human_readable_size} from LogLine where #{filter} group by ip order by count(ip) desc limit #{options[:limit]}"
|
72
72
|
@referers = db.execute "SELECT referer, count(referer), count(distinct(unique_visitor)), #{human_readable_size} from LogLine where #{filter} group by referer order by count(referer) desc limit #{options[:limit]}"
|
73
73
|
|
74
|
+
@streaks = db.execute "SELECT ip, substr(datetime, 1, 10), path from LogLine order by ip, datetime"
|
75
|
+
|
74
76
|
data = {}
|
75
77
|
self.instance_variables.each do |variable|
|
76
78
|
var_as_symbol = variable.to_s[1..-1].to_sym
|
@@ -50,7 +50,7 @@ module ApacheLogReport
|
|
50
50
|
args[:code_export] = n
|
51
51
|
end
|
52
52
|
|
53
|
-
opts.on("-fFORMAT", "--format=FORMAT", String, "Output format: html, org. Defaults to org mode") do |n|
|
53
|
+
opts.on("-fFORMAT", "--format=FORMAT", String, "Output format: html, org, sqlite. Defaults to org mode") do |n|
|
54
54
|
args[:output_format] = n
|
55
55
|
end
|
56
56
|
|
@@ -26,9 +26,17 @@
|
|
26
26
|
<th class="tx">Tx</th>
|
27
27
|
<td class="tx"><%= data[:total_size][0][0] %></td>
|
28
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>
|
29
37
|
<tr>
|
30
38
|
<th class="days">Days </th>
|
31
|
-
<td class="days"><%= data[:total_days]
|
39
|
+
<td class="days"><%= data[:total_days] %></td>
|
32
40
|
</tr>
|
33
41
|
</table>
|
34
42
|
</article>
|
@@ -56,6 +64,34 @@
|
|
56
64
|
</article>
|
57
65
|
<% end %>
|
58
66
|
|
67
|
+
<article>
|
68
|
+
<h2>Streaks</h2>
|
69
|
+
|
70
|
+
<table class="streaks">
|
71
|
+
<thead>
|
72
|
+
<tr>
|
73
|
+
<th>IP</th>
|
74
|
+
<th>Day</th>
|
75
|
+
<th>URL</th>
|
76
|
+
</tr>
|
77
|
+
</thead>
|
78
|
+
<tbody>
|
79
|
+
<% data[:streaks].group_by(&:first).each do |ip, date_urls| %>
|
80
|
+
<tr>
|
81
|
+
<td class="ip"><%= ip %></td>
|
82
|
+
<td class="streaks">
|
83
|
+
<% date_urls.group_by(&:first).each do |date, urls| %>
|
84
|
+
<% urls.each do |url| %>
|
85
|
+
<b><%= url[1] %>:</b> <%= url[2] %> <br />
|
86
|
+
<% end %>
|
87
|
+
<% end %>
|
88
|
+
</td>
|
89
|
+
</tr>
|
90
|
+
<% end %>
|
91
|
+
</tbody>
|
92
|
+
</table>
|
93
|
+
</article>
|
94
|
+
|
59
95
|
<article>
|
60
96
|
<h2>Command Invocation and Performance</h2>
|
61
97
|
|
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.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adolfo Villafiorita
|
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
118
|
- !ruby/object:Gem::Version
|
119
119
|
version: '0'
|
120
120
|
requirements: []
|
121
|
-
rubygems_version: 3.
|
121
|
+
rubygems_version: 3.2.22
|
122
122
|
signing_key:
|
123
123
|
specification_version: 4
|
124
124
|
summary: Generate a request report in OrgMode format from an Apache log file.
|