weblog-parser 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +28 -12
- data/lib/log_parser/version.rb +1 -1
- data/weblog_parser.gemspec +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a39ee84c80475a33bf073af960a42f30517bb881d273367779d31fb124d16d9a
|
4
|
+
data.tar.gz: 2bcb4ff7114711eb946b6843a510a525545045111689ad00a77100f66fd8eaa6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 342d756d1a9e37afdaedd26cdeda7dae52301e18989172500bb612cb1c9e1fe72add609ff4ccbe73713328fb2ca34e59f754ee49fb106aa0c4aaae7d7e97be3f
|
7
|
+
data.tar.gz: 210d60841f0fdf4957f06998f5a4ccb52ceda56d02c15e2477bf246f49f4baf534f7dfa16b59df4accb5aef51b8e407f34a0bfdba40434bc2cb40daa66fad6fd
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# WebLog Parser - Readme
|
2
2
|
|
3
3
|
## Installing
|
4
4
|
|
@@ -6,20 +6,34 @@
|
|
6
6
|
|
7
7
|
## Usage
|
8
8
|
|
9
|
-
|
10
|
-
It uses a command-line interface.
|
9
|
+
WebLog Parser reads a webserver logfile and counts page visits and unique page
|
10
|
+
views. It uses a command-line interface.
|
11
|
+
|
12
|
+
### Getting Started
|
13
|
+
|
14
|
+
An example log file can be found at https://tinyurl.com/ve8x3qs
|
15
|
+
You can download this file and name it 'weblog.log'.
|
16
|
+
Then run the command:
|
17
|
+
|
18
|
+
`wlparser -i -f weblog.log`
|
19
|
+
|
20
|
+
This will read the log file and validates either ip4 or ip6 addresses. The file
|
21
|
+
contains both, so if you don't use the -i option, it will show some errors as
|
22
|
+
the default is ip4.
|
23
|
+
|
24
|
+
### Options
|
11
25
|
|
12
26
|
`wlparser -h`
|
13
27
|
`wlparser --help`
|
14
28
|
|
15
29
|
Shows a list of options
|
16
30
|
|
17
|
-
`wlparser -f logfile.log`
|
31
|
+
`wlparser -f logfile.log`
|
18
32
|
`wlparser --file logfile.log`
|
19
33
|
|
20
34
|
Reads a log file and display results:
|
21
35
|
|
22
|
-
`wlparser -m 'logfile1.log logfile2.log'`
|
36
|
+
`wlparser -m 'logfile1.log logfile2.log'`
|
23
37
|
`wlparser --multiple_files 'logfile1.log logfile2.log'`
|
24
38
|
|
25
39
|
Reads a list of log files in quotes and displays results. All files give
|
@@ -83,7 +97,7 @@ Validates ip addresses using ip6 format.
|
|
83
97
|
`wlparser -6`
|
84
98
|
`wlparser --ip4ip6_validation`
|
85
99
|
|
86
|
-
Validates ip addresses if
|
100
|
+
Validates ip addresses if they matches either ip4 or ip6 format.
|
87
101
|
|
88
102
|
`wlparser -I`
|
89
103
|
`wlparser --no_ip_validation`
|
@@ -103,7 +117,7 @@ Does not validate webpage path, assumes they are all valid.
|
|
103
117
|
`wlparser -r`
|
104
118
|
`wlparser --remove_invalid`
|
105
119
|
|
106
|
-
Ignore logs
|
120
|
+
Ignore logs if either ip address or path is invalid.
|
107
121
|
|
108
122
|
`wlparser -R`
|
109
123
|
`wlparser --warn_invalid`
|
@@ -129,7 +143,7 @@ Displays unique page views in results and in text file output (default).
|
|
129
143
|
`wlparser -U`
|
130
144
|
`wlparser --no_unique_page_views`
|
131
145
|
|
132
|
-
|
146
|
+
Does not display unique page views in results or text file output (default).
|
133
147
|
|
134
148
|
##Log Format
|
135
149
|
|
@@ -141,8 +155,7 @@ Example log with ip4 address:
|
|
141
155
|
|
142
156
|
Logs can use either using ip4 addresses or ip6 addresses.
|
143
157
|
|
144
|
-
ip4 addresses should be valid i.e. between 0.0.0.0 and 255.255.255.255, although
|
145
|
-
you can skip this check.
|
158
|
+
ip4 addresses should be valid i.e. between 0.0.0.0 and 255.255.255.255, although you can skip this check.
|
146
159
|
|
147
160
|
Example log with ip6 address:
|
148
161
|
`\webpage\index 1234:1234:1234:1234:1234:1234:1234:1234`
|
@@ -153,10 +166,12 @@ ip6 addresses can be compressed e.g.
|
|
153
166
|
|
154
167
|
## Testing
|
155
168
|
|
156
|
-
Tests can be run using:
|
169
|
+
Tests can be run from the cloned repository using:
|
157
170
|
|
158
171
|
`rake test`
|
159
172
|
|
173
|
+
The git repository is: https://github.com/davidmorton0/WebLogParser
|
174
|
+
|
160
175
|
Tests have been separated into
|
161
176
|
* unit tests - test methods in each class
|
162
177
|
* integration tests - test the whole app
|
@@ -176,7 +191,8 @@ Note that the dependencies to Constants are not shown.
|
|
176
191
|
### Classes
|
177
192
|
|
178
193
|
* Parser - Holds the log information and changes the format
|
179
|
-
* LogReader - Loads files then reads logs. Validates logs, ip addresses and
|
194
|
+
* LogReader - Loads files then reads logs. Validates logs, ip addresses and
|
195
|
+
paths
|
180
196
|
* ipValidator - Validates ip addresses
|
181
197
|
* PathValidator - Validates the path for the webpage
|
182
198
|
* OptionHandler - Sets the options from the command line arguments given
|
data/lib/log_parser/version.rb
CHANGED
data/weblog_parser.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.email = ["davidmorton0@gmail.com"]
|
10
10
|
|
11
11
|
spec.summary = %q{A command line parser for web server logs}
|
12
|
-
spec.homepage = "https://github.com/davidmorton0/
|
12
|
+
spec.homepage = "https://github.com/davidmorton0/WebLogParser"
|
13
13
|
spec.license = "MIT"
|
14
14
|
|
15
15
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
#spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
19
19
|
|
20
20
|
#spec.metadata["homepage_uri"] = spec.homepage
|
21
|
-
spec.metadata["source_code_uri"] = "https://github.com/davidmorton0/
|
21
|
+
spec.metadata["source_code_uri"] = "https://github.com/davidmorton0/WebLogParser"
|
22
22
|
#spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
|
23
23
|
else
|
24
24
|
raise "RubyGems 2.0 or newer is required to protect against " \
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: weblog-parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Morton
|
@@ -84,11 +84,11 @@ files:
|
|
84
84
|
- lib/log_parser/version.rb
|
85
85
|
- lib/log_parser/warning_handler.rb
|
86
86
|
- weblog_parser.gemspec
|
87
|
-
homepage: https://github.com/davidmorton0/
|
87
|
+
homepage: https://github.com/davidmorton0/WebLogParser
|
88
88
|
licenses:
|
89
89
|
- MIT
|
90
90
|
metadata:
|
91
|
-
source_code_uri: https://github.com/davidmorton0/
|
91
|
+
source_code_uri: https://github.com/davidmorton0/WebLogParser
|
92
92
|
post_install_message:
|
93
93
|
rdoc_options: []
|
94
94
|
require_paths:
|