apache_log_report 0.9.3 → 0.9.8
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 +29 -0
- data/README.org +7 -0
- data/exe/apache_log_report +0 -0
- data/lib/apache_log_report.rb +25 -14
- data/lib/apache_log_report/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77ddb670e22eb7d75ebd658beecb96a452b9c65ace149f2a8376921271063d84
|
4
|
+
data.tar.gz: 33f6690db108ac0c4d9f8619f90add9ec5f9ac4d5414b38127413ea618b8e46f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8074e3498f0b8f5e8769f5fccade340cb85f7bfa8dc5393197d216b1f22329bd14484c0ab45e5dcfa11f5dd26f007dbd44fa666273e1e50a14cbfdfa5c835ba
|
7
|
+
data.tar.gz: fda701c90b667b09d6a385ab23da6a10725624256cb92eb9521f53b119bf461a1a147db6fb6cb1b191dfcf874b920852fdb13c5f125f38f788657e8b9c8a6c9e
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
apache_log_report (0.9.7)
|
5
|
+
apache_log-parser
|
6
|
+
browser
|
7
|
+
sqlite3
|
8
|
+
terminal-table
|
9
|
+
|
10
|
+
GEM
|
11
|
+
remote: https://rubygems.org/
|
12
|
+
specs:
|
13
|
+
apache_log-parser (3.1.2)
|
14
|
+
browser (5.0.0)
|
15
|
+
rake (12.3.3)
|
16
|
+
sqlite3 (1.4.2)
|
17
|
+
terminal-table (1.8.0)
|
18
|
+
unicode-display_width (~> 1.1, >= 1.1.1)
|
19
|
+
unicode-display_width (1.7.0)
|
20
|
+
|
21
|
+
PLATFORMS
|
22
|
+
ruby
|
23
|
+
|
24
|
+
DEPENDENCIES
|
25
|
+
apache_log_report!
|
26
|
+
rake (~> 12.0)
|
27
|
+
|
28
|
+
BUNDLED WITH
|
29
|
+
2.1.4
|
data/README.org
CHANGED
@@ -12,6 +12,13 @@
|
|
12
12
|
|
13
13
|
See the [[file:CHANGELOG.org][CHANGELOG]] file.
|
14
14
|
|
15
|
+
* Todo
|
16
|
+
|
17
|
+
** TODO Version information from command line and in reports
|
18
|
+
** TODO Refactor code from one giant class to more manageable chunkes
|
19
|
+
** TODO Move performance stats var to class (to isolate vars)
|
20
|
+
** TODO Check total number of days (which is not working, now)
|
21
|
+
|
15
22
|
* Compatibility
|
16
23
|
|
17
24
|
|
data/exe/apache_log_report
CHANGED
File without changes
|
data/lib/apache_log_report.rb
CHANGED
@@ -5,13 +5,14 @@ module ApacheLogReport
|
|
5
5
|
#
|
6
6
|
require 'optparse'
|
7
7
|
require 'optparse/date'
|
8
|
+
require 'apache_log_report/version'
|
8
9
|
|
9
10
|
def self.options_parse options
|
10
11
|
limit = 30
|
11
12
|
args = {}
|
12
13
|
|
13
14
|
opt_parser = OptionParser.new do |opts|
|
14
|
-
opts.banner = "Usage:
|
15
|
+
opts.banner = "Usage: apache_log_report [options] [logfile]"
|
15
16
|
|
16
17
|
opts.on("-lN", "--limit=N", Integer, "Number of entries to show (defaults to #{limit})") do |n|
|
17
18
|
args[:limit] = n
|
@@ -25,32 +26,42 @@ module ApacheLogReport
|
|
25
26
|
args[:to_date] = n
|
26
27
|
end
|
27
28
|
|
28
|
-
opts.on("-i", "--ignore-crawlers", "Ignore crawlers") do
|
29
|
+
opts.on("-i", "--ignore-crawlers", "Ignore crawlers") do
|
29
30
|
args[:ignore_crawlers] = true
|
30
31
|
end
|
31
32
|
|
32
|
-
opts.on("-p", "--ignore-selfpoll", "Ignore apaches self poll entries (from ::1)") do
|
33
|
+
opts.on("-p", "--ignore-selfpoll", "Ignore apaches self poll entries (from ::1)") do
|
33
34
|
args[:no_selfpoll] = true
|
34
35
|
end
|
35
36
|
|
36
|
-
opts.on("-c", "--only-crawlers", "Perform analysis on crawlers only") do
|
37
|
+
opts.on("-c", "--only-crawlers", "Perform analysis on crawlers only") do
|
37
38
|
args[:only_crawlers] = true
|
38
39
|
end
|
39
40
|
|
40
|
-
opts.on("-
|
41
|
+
opts.on("-uPREFIX", "--prefix=PREFIX", String, "Prefix to add to all plots (used to run multiple analyses in the same dir)") do |n|
|
41
42
|
args[:prefix] = n
|
42
43
|
end
|
43
44
|
|
44
|
-
opts.on("-
|
45
|
+
opts.on("-wSUFFIX", "--suffix=SUFFIX", String, "Suffix to add to all plots (used to run multiple analyses in the same dir)") do |n|
|
45
46
|
args[:suffix] = n
|
46
47
|
end
|
47
48
|
|
48
|
-
opts.on("-
|
49
|
+
opts.on("-cWHAT", "--code-export=WHAT", String, "Control :export directive in code blocks (code, results, *both*, none)") do |n|
|
49
50
|
args[:code_export] = n
|
50
51
|
end
|
51
52
|
|
53
|
+
opts.on("-v", "--version", "Prints version information") do
|
54
|
+
puts "apache_log_report version #{ApacheLogReport::VERSION}"
|
55
|
+
puts "Copyright (C) 2020 Adolfo Villafiorita"
|
56
|
+
puts "Distributed under the terms of the MIT license"
|
57
|
+
puts ""
|
58
|
+
puts "Written by Adolfo Villafiorita"
|
59
|
+
exit
|
60
|
+
end
|
61
|
+
|
52
62
|
opts.on("-h", "--help", "Prints this help") do
|
53
63
|
puts opts
|
64
|
+
puts "This is version #{ApacheLogReport::VERSION}"
|
54
65
|
exit
|
55
66
|
end
|
56
67
|
end
|
@@ -130,7 +141,7 @@ module ApacheLogReport
|
|
130
141
|
hash[:datetime].iso8601,
|
131
142
|
hash[:remote_host],
|
132
143
|
hash[:user],
|
133
|
-
hash[:datetime].
|
144
|
+
hash[:datetime].strftime("%Y-%m-%d") + " " + hash[:remote_host] + " " + hash[:user_agent],
|
134
145
|
hash[:request][:method],
|
135
146
|
hash[:request][:path],
|
136
147
|
(hash[:request][:path] ? File.extname(hash[:request][:path]) : ""),
|
@@ -236,9 +247,9 @@ module ApacheLogReport
|
|
236
247
|
end
|
237
248
|
|
238
249
|
def self.emit options = {}, command, log_file, started_at, ended_at, duration
|
239
|
-
@
|
250
|
+
@prefix = options[:prefix]
|
240
251
|
@suffix = options[:suffix]
|
241
|
-
@export =
|
252
|
+
@export = options[:code_export]
|
242
253
|
|
243
254
|
<<EOS
|
244
255
|
#+TITLE: Apache Log Analysis: #{log_file}
|
@@ -393,12 +404,12 @@ set boxwidth 0.6
|
|
393
404
|
set style data histograms
|
394
405
|
set style histogram clustered gap 1
|
395
406
|
|
396
|
-
plot data using 2:xtic(1) lc rgb "#
|
407
|
+
plot data using 2:xtic(1) lc rgb "#00AA00" title "2xx", \\
|
397
408
|
data using 3 lc rgb "#0000CC" title "3xx", \\
|
398
|
-
data using 4 lc rgb "#
|
399
|
-
data using ($0 - 1. / 4):($2 + 0.5):2 with labels title "" textcolor rgb("#
|
409
|
+
data using 4 lc rgb "#AA0000" title "4xx", \\
|
410
|
+
data using ($0 - 1. / 4):($2 + 0.5):2 with labels title "" textcolor rgb("#00AA00"), \\
|
400
411
|
data using ($0):($3 + 0.5):3 with labels title "" textcolor rgb("#0000CC"), \\
|
401
|
-
data using ($0 + 1. / 4):($4 + 0.5):4 with labels title "" textcolor rgb("#
|
412
|
+
data using ($0 + 1. / 4):($4 + 0.5):4 with labels title "" textcolor rgb("#AA0000")
|
402
413
|
#+END_SRC
|
403
414
|
|
404
415
|
* Browsers
|
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: 0.9.
|
4
|
+
version: 0.9.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adolfo Villafiorita
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: apache_log-parser
|
@@ -77,6 +77,7 @@ files:
|
|
77
77
|
- ".gitignore"
|
78
78
|
- CHANGELOG.org
|
79
79
|
- Gemfile
|
80
|
+
- Gemfile.lock
|
80
81
|
- LICENSE.txt
|
81
82
|
- README.org
|
82
83
|
- Rakefile
|
@@ -109,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
110
|
- !ruby/object:Gem::Version
|
110
111
|
version: '0'
|
111
112
|
requirements: []
|
112
|
-
rubygems_version: 3.
|
113
|
+
rubygems_version: 3.0.3
|
113
114
|
signing_key:
|
114
115
|
specification_version: 4
|
115
116
|
summary: Generate a request report in OrgMode format from an Apache log file.
|