vizi_tracker 0.1.0
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.
- data/README.rdoc +116 -0
- data/Rakefile +44 -0
- data/config/logger-backup.yml +49 -0
- data/config/logger.yml +69 -0
- data/config/logger_apache.yml +65 -0
- data/config/logger_sample.yml +69 -0
- data/data/exlog.log +5458 -0
- data/data/sample-alter.log +11870 -0
- data/data/sample-surf.log +47 -0
- data/data/sample-wle.log +30474 -0
- data/data/testlog.log +270 -0
- data/data/vizitrax.log +17951 -0
- data/doc/Object.html +200 -0
- data/doc/ParserTest.html +268 -0
- data/doc/README_rdoc.html +128 -0
- data/doc/Rakefile.html +148 -0
- data/doc/Visit.html +487 -0
- data/doc/VisitList.html +385 -0
- data/doc/Vizi/LogFormat.html +377 -0
- data/doc/Vizi/LogParser.html +551 -0
- data/doc/Vizi/Visit.html +487 -0
- data/doc/Vizi/VisitList.html +386 -0
- data/doc/Vizi.html +168 -0
- data/doc/ViziLogFormat.html +382 -0
- data/doc/ViziLogParser.html +551 -0
- data/doc/created.rid +8 -0
- data/doc/formats/apache-custom-log.pdf +0 -0
- data/doc/formats/apache.rtf +238 -0
- data/doc/formats/format-descriptions.xls +0 -0
- data/doc/formats/w3c-extended.pdf +0 -0
- data/doc/formats/w3c-extended.rtf +135 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +112 -0
- data/doc/js/darkfish.js +116 -0
- data/doc/js/jquery.js +32 -0
- data/doc/js/quicksearch.js +114 -0
- data/doc/js/thickbox-compressed.js +10 -0
- data/doc/lib/vizi/parser_rb.html +63 -0
- data/doc/lib/vizi/vizi_tracker_rb.html +63 -0
- data/doc/lib/vizi_log_parser_rb.html +56 -0
- data/doc/lib/vizi_tracker_rb.html +56 -0
- data/doc/rdoc.css +759 -0
- data/doc/test/parser_test_rb.html +54 -0
- data/doc/test/test_helper_rb.html +56 -0
- data/doc/testit_rb.html +63 -0
- data/lib/vizi/vizi_tracker.rb +406 -0
- data/lib/vizi_tracker.rb +5 -0
- data/log/parse.log +79 -0
- data/log/system.log +66 -0
- data/test/parser_test.rb +48 -0
- data/test/test_helper.rb +3 -0
- data/testit.rb +105 -0
- data/vizi_tracker.gemspec +21 -0
- metadata +146 -0
data/doc/Object.html
ADDED
@@ -0,0 +1,200 @@
|
|
1
|
+
<?xml version="1.0" encoding="IBM437"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta content="text/html; charset=IBM437" http-equiv="Content-Type" />
|
7
|
+
|
8
|
+
<title>Class: Object</title>
|
9
|
+
|
10
|
+
<link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />
|
11
|
+
|
12
|
+
<script src="./js/jquery.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
<script src="./js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
|
14
|
+
<script src="./js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
|
15
|
+
<script src="./js/darkfish.js" type="text/javascript" charset="utf-8"></script>
|
16
|
+
|
17
|
+
</head>
|
18
|
+
<body id="top" class="class">
|
19
|
+
|
20
|
+
<div id="metadata">
|
21
|
+
<div id="home-metadata">
|
22
|
+
<div id="home-section" class="section">
|
23
|
+
<h3 class="section-header">
|
24
|
+
<a href="./index.html">Home</a>
|
25
|
+
<a href="./index.html#classes">Classes</a>
|
26
|
+
<a href="./index.html#methods">Methods</a>
|
27
|
+
</h3>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
|
31
|
+
<div id="file-metadata">
|
32
|
+
<div id="file-list-section" class="section">
|
33
|
+
<h3 class="section-header">In Files</h3>
|
34
|
+
<div class="section-body">
|
35
|
+
<ul>
|
36
|
+
|
37
|
+
<li><a href="./testit_rb.html?TB_iframe=true&height=550&width=785"
|
38
|
+
class="thickbox" title="testit.rb">testit.rb</a></li>
|
39
|
+
|
40
|
+
</ul>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<div id="class-metadata">
|
48
|
+
|
49
|
+
<!-- Parent Class -->
|
50
|
+
<div id="parent-class-section" class="section">
|
51
|
+
<h3 class="section-header">Parent</h3>
|
52
|
+
|
53
|
+
<p class="link"></p>
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
<!-- Method Quickref -->
|
64
|
+
<div id="method-list-section" class="section">
|
65
|
+
<h3 class="section-header">Methods</h3>
|
66
|
+
<ul class="link-list">
|
67
|
+
|
68
|
+
<li><a href="#method-i-find_visit_in_list">#find_visit_in_list</a></li>
|
69
|
+
|
70
|
+
</ul>
|
71
|
+
</div>
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
</div>
|
76
|
+
|
77
|
+
<div id="project-metadata">
|
78
|
+
|
79
|
+
|
80
|
+
<div id="fileindex-section" class="section project-section">
|
81
|
+
<h3 class="section-header">Files</h3>
|
82
|
+
<ul>
|
83
|
+
|
84
|
+
<li class="file"><a href="./README_rdoc.html">README.rdoc</a></li>
|
85
|
+
|
86
|
+
<li class="file"><a href="./Rakefile.html">Rakefile</a></li>
|
87
|
+
|
88
|
+
</ul>
|
89
|
+
</div>
|
90
|
+
|
91
|
+
|
92
|
+
<div id="classindex-section" class="section project-section">
|
93
|
+
<h3 class="section-header">Class/Module Index
|
94
|
+
<span class="search-toggle"><img src="./images/find.png"
|
95
|
+
height="16" width="16" alt="[+]"
|
96
|
+
title="show/hide quicksearch" /></span></h3>
|
97
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
98
|
+
<fieldset>
|
99
|
+
<legend>Quicksearch</legend>
|
100
|
+
<input type="text" name="quicksearch" value=""
|
101
|
+
class="quicksearch-field" />
|
102
|
+
</fieldset>
|
103
|
+
</form>
|
104
|
+
|
105
|
+
<ul class="link-list">
|
106
|
+
|
107
|
+
<li><a href="./Vizi.html">Vizi</a></li>
|
108
|
+
|
109
|
+
<li><a href="./Vizi/LogFormat.html">Vizi::LogFormat</a></li>
|
110
|
+
|
111
|
+
<li><a href="./Vizi/LogParser.html">Vizi::LogParser</a></li>
|
112
|
+
|
113
|
+
<li><a href="./Vizi/Visit.html">Vizi::Visit</a></li>
|
114
|
+
|
115
|
+
<li><a href="./Vizi/VisitList.html">Vizi::VisitList</a></li>
|
116
|
+
|
117
|
+
<li><a href="./Object.html">Object</a></li>
|
118
|
+
|
119
|
+
<li><a href="./ParserTest.html">ParserTest</a></li>
|
120
|
+
|
121
|
+
</ul>
|
122
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
123
|
+
</div>
|
124
|
+
|
125
|
+
|
126
|
+
</div>
|
127
|
+
</div>
|
128
|
+
|
129
|
+
<div id="documentation">
|
130
|
+
<h1 class="class">Object</h1>
|
131
|
+
|
132
|
+
<div id="description" class="description">
|
133
|
+
|
134
|
+
</div><!-- description -->
|
135
|
+
|
136
|
+
|
137
|
+
<div id="5Buntitled-5D" class="documentation-section">
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
<!-- Methods -->
|
147
|
+
|
148
|
+
<div id="public-instance-method-details" class="method-section section">
|
149
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
150
|
+
|
151
|
+
|
152
|
+
<div id="find_visit_in_list-method" class="method-detail ">
|
153
|
+
<a name="method-i-find_visit_in_list"></a>
|
154
|
+
|
155
|
+
|
156
|
+
<div class="method-heading">
|
157
|
+
<span class="method-name">find_visit_in_list</span><span
|
158
|
+
class="method-args">(ip)</span>
|
159
|
+
<span class="method-click-advice">click to toggle source</span>
|
160
|
+
</div>
|
161
|
+
|
162
|
+
|
163
|
+
<div class="method-description">
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
<div class="method-source-code" id="find_visit_in_list-source">
|
170
|
+
<pre>
|
171
|
+
<span class="ruby-comment"># File testit.rb, line 18</span>
|
172
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">find_visit_in_list</span>(<span class="ruby-identifier">ip</span>)
|
173
|
+
<span class="ruby-ivar">@visits</span>.<span class="ruby-identifier">detect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">visit</span><span class="ruby-operator">|</span> <span class="ruby-identifier">visit</span>.<span class="ruby-identifier">ip</span> = <span class="ruby-identifier">ip</span> }
|
174
|
+
<span class="ruby-keyword">end</span></pre>
|
175
|
+
</div><!-- find_visit_in_list-source -->
|
176
|
+
|
177
|
+
</div>
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
</div><!-- find_visit_in_list-method -->
|
183
|
+
|
184
|
+
|
185
|
+
</div><!-- public-instance-method-details -->
|
186
|
+
|
187
|
+
</div><!-- 5Buntitled-5D -->
|
188
|
+
|
189
|
+
|
190
|
+
</div><!-- documentation -->
|
191
|
+
|
192
|
+
<div id="validator-badges">
|
193
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
194
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
195
|
+
Rdoc Generator</a> 2</small>.</p>
|
196
|
+
</div>
|
197
|
+
|
198
|
+
</body>
|
199
|
+
</html>
|
200
|
+
|
data/doc/ParserTest.html
ADDED
@@ -0,0 +1,268 @@
|
|
1
|
+
<?xml version="1.0" encoding="IBM437"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta content="text/html; charset=IBM437" http-equiv="Content-Type" />
|
7
|
+
|
8
|
+
<title>Class: ParserTest</title>
|
9
|
+
|
10
|
+
<link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />
|
11
|
+
|
12
|
+
<script src="./js/jquery.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
<script src="./js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
|
14
|
+
<script src="./js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
|
15
|
+
<script src="./js/darkfish.js" type="text/javascript" charset="utf-8"></script>
|
16
|
+
|
17
|
+
</head>
|
18
|
+
<body id="top" class="class">
|
19
|
+
|
20
|
+
<div id="metadata">
|
21
|
+
<div id="home-metadata">
|
22
|
+
<div id="home-section" class="section">
|
23
|
+
<h3 class="section-header">
|
24
|
+
<a href="./index.html">Home</a>
|
25
|
+
<a href="./index.html#classes">Classes</a>
|
26
|
+
<a href="./index.html#methods">Methods</a>
|
27
|
+
</h3>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
|
31
|
+
<div id="file-metadata">
|
32
|
+
<div id="file-list-section" class="section">
|
33
|
+
<h3 class="section-header">In Files</h3>
|
34
|
+
<div class="section-body">
|
35
|
+
<ul>
|
36
|
+
|
37
|
+
<li><a href="./test/parser_test_rb.html?TB_iframe=true&height=550&width=785"
|
38
|
+
class="thickbox" title="test/parser_test.rb">test/parser_test.rb</a></li>
|
39
|
+
|
40
|
+
</ul>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<div id="class-metadata">
|
48
|
+
|
49
|
+
<!-- Parent Class -->
|
50
|
+
<div id="parent-class-section" class="section">
|
51
|
+
<h3 class="section-header">Parent</h3>
|
52
|
+
|
53
|
+
<p class="link">Test::Unit::TestCase</p>
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
<!-- Method Quickref -->
|
64
|
+
<div id="method-list-section" class="section">
|
65
|
+
<h3 class="section-header">Methods</h3>
|
66
|
+
<ul class="link-list">
|
67
|
+
|
68
|
+
<li><a href="#method-i-test_parser_creation">#test_parser_creation</a></li>
|
69
|
+
|
70
|
+
<li><a href="#method-i-test_simple_parsing">#test_simple_parsing</a></li>
|
71
|
+
|
72
|
+
</ul>
|
73
|
+
</div>
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
</div>
|
78
|
+
|
79
|
+
<div id="project-metadata">
|
80
|
+
|
81
|
+
|
82
|
+
<div id="fileindex-section" class="section project-section">
|
83
|
+
<h3 class="section-header">Files</h3>
|
84
|
+
<ul>
|
85
|
+
|
86
|
+
<li class="file"><a href="./README_rdoc.html">README.rdoc</a></li>
|
87
|
+
|
88
|
+
<li class="file"><a href="./Rakefile.html">Rakefile</a></li>
|
89
|
+
|
90
|
+
</ul>
|
91
|
+
</div>
|
92
|
+
|
93
|
+
|
94
|
+
<div id="classindex-section" class="section project-section">
|
95
|
+
<h3 class="section-header">Class/Module Index
|
96
|
+
<span class="search-toggle"><img src="./images/find.png"
|
97
|
+
height="16" width="16" alt="[+]"
|
98
|
+
title="show/hide quicksearch" /></span></h3>
|
99
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
100
|
+
<fieldset>
|
101
|
+
<legend>Quicksearch</legend>
|
102
|
+
<input type="text" name="quicksearch" value=""
|
103
|
+
class="quicksearch-field" />
|
104
|
+
</fieldset>
|
105
|
+
</form>
|
106
|
+
|
107
|
+
<ul class="link-list">
|
108
|
+
|
109
|
+
<li><a href="./Vizi.html">Vizi</a></li>
|
110
|
+
|
111
|
+
<li><a href="./Vizi/LogFormat.html">Vizi::LogFormat</a></li>
|
112
|
+
|
113
|
+
<li><a href="./Vizi/LogParser.html">Vizi::LogParser</a></li>
|
114
|
+
|
115
|
+
<li><a href="./Vizi/Visit.html">Vizi::Visit</a></li>
|
116
|
+
|
117
|
+
<li><a href="./Vizi/VisitList.html">Vizi::VisitList</a></li>
|
118
|
+
|
119
|
+
<li><a href="./Object.html">Object</a></li>
|
120
|
+
|
121
|
+
<li><a href="./ParserTest.html">ParserTest</a></li>
|
122
|
+
|
123
|
+
</ul>
|
124
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
125
|
+
</div>
|
126
|
+
|
127
|
+
|
128
|
+
</div>
|
129
|
+
</div>
|
130
|
+
|
131
|
+
<div id="documentation">
|
132
|
+
<h1 class="class">ParserTest</h1>
|
133
|
+
|
134
|
+
<div id="description" class="description">
|
135
|
+
|
136
|
+
</div><!-- description -->
|
137
|
+
|
138
|
+
|
139
|
+
<div id="5Buntitled-5D" class="documentation-section">
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
<!-- Methods -->
|
149
|
+
|
150
|
+
<div id="public-instance-method-details" class="method-section section">
|
151
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
152
|
+
|
153
|
+
|
154
|
+
<div id="test_parser_creation-method" class="method-detail ">
|
155
|
+
<a name="method-i-test_parser_creation"></a>
|
156
|
+
|
157
|
+
|
158
|
+
<div class="method-heading">
|
159
|
+
<span class="method-name">test_parser_creation</span><span
|
160
|
+
class="method-args">()</span>
|
161
|
+
<span class="method-click-advice">click to toggle source</span>
|
162
|
+
</div>
|
163
|
+
|
164
|
+
|
165
|
+
<div class="method-description">
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
<div class="method-source-code" id="test_parser_creation-source">
|
172
|
+
<pre>
|
173
|
+
<span class="ruby-comment"># File test/parser_test.rb, line 7</span>
|
174
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">test_parser_creation</span>
|
175
|
+
|
176
|
+
<span class="ruby-identifier">parser</span> = <span class="ruby-constant">HttpLogParser</span>.<span class="ruby-identifier">new</span>
|
177
|
+
<span class="ruby-identifier">assert_not_nil</span> <span class="ruby-identifier">parser</span>
|
178
|
+
<span class="ruby-identifier">assert_equal</span> <span class="ruby-value">5</span>, <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">formats</span>.<span class="ruby-identifier">size</span>
|
179
|
+
|
180
|
+
<span class="ruby-identifier">parser</span> = <span class="ruby-constant">HttpLogParser</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">'%h %l %u %t \"%r\" %>s %b'</span>)
|
181
|
+
<span class="ruby-identifier">assert_not_nil</span> <span class="ruby-identifier">parser</span>
|
182
|
+
<span class="ruby-identifier">assert_equal</span> <span class="ruby-value">1</span>, <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">formats</span>.<span class="ruby-identifier">size</span>
|
183
|
+
|
184
|
+
<span class="ruby-identifier">parser</span> = <span class="ruby-constant">HttpLogParser</span>.<span class="ruby-identifier">new</span>({
|
185
|
+
<span class="ruby-value">:common</span> =<span class="ruby-operator">></span> <span class="ruby-string">'%h %l %u %t \"%r\" %>s %b'</span>,
|
186
|
+
<span class="ruby-value">:common_with_virtual</span> =<span class="ruby-operator">></span> <span class="ruby-string">'%v %h %l %u %t \"%r\" %>s %b'</span>,
|
187
|
+
})
|
188
|
+
<span class="ruby-identifier">assert_not_nil</span> <span class="ruby-identifier">parser</span>
|
189
|
+
<span class="ruby-identifier">assert_equal</span> <span class="ruby-value">2</span>, <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">formats</span>.<span class="ruby-identifier">size</span>
|
190
|
+
|
191
|
+
<span class="ruby-keyword">end</span></pre>
|
192
|
+
</div><!-- test_parser_creation-source -->
|
193
|
+
|
194
|
+
</div>
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
</div><!-- test_parser_creation-method -->
|
200
|
+
|
201
|
+
|
202
|
+
<div id="test_simple_parsing-method" class="method-detail ">
|
203
|
+
<a name="method-i-test_simple_parsing"></a>
|
204
|
+
|
205
|
+
|
206
|
+
<div class="method-heading">
|
207
|
+
<span class="method-name">test_simple_parsing</span><span
|
208
|
+
class="method-args">()</span>
|
209
|
+
<span class="method-click-advice">click to toggle source</span>
|
210
|
+
</div>
|
211
|
+
|
212
|
+
|
213
|
+
<div class="method-description">
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
<div class="method-source-code" id="test_simple_parsing-source">
|
220
|
+
<pre>
|
221
|
+
<span class="ruby-comment"># File test/parser_test.rb, line 26</span>
|
222
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">test_simple_parsing</span>
|
223
|
+
|
224
|
+
<span class="ruby-identifier">parser</span> = <span class="ruby-constant">HttpLogParser</span>.<span class="ruby-identifier">new</span>
|
225
|
+
<span class="ruby-identifier">assert_not_nil</span> <span class="ruby-identifier">parser</span>
|
226
|
+
|
227
|
+
<span class="ruby-identifier">parsed</span> = <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">parse_line</span>(<span class="ruby-string">'111.222.333.444 - - [21/Apr/2010:01:02:03 +0000] "GET /some/url?some=parameter HTTP/1.1" 302 123 "http://somewhere.com" "Browser (Version 1.0)"'</span>)
|
228
|
+
|
229
|
+
<span class="ruby-identifier">assert_equal</span> <span class="ruby-string">'111.222.333.444'</span>, <span class="ruby-identifier">parsed</span>[<span class="ruby-value">:ip</span>]
|
230
|
+
<span class="ruby-identifier">assert_equal</span> <span class="ruby-string">'111.222.333.444'</span>, <span class="ruby-identifier">parsed</span>[<span class="ruby-value">:domain</span>]
|
231
|
+
<span class="ruby-identifier">assert_equal</span> <span class="ruby-string">'-'</span>, <span class="ruby-identifier">parsed</span>[<span class="ruby-value">:auth</span>]
|
232
|
+
<span class="ruby-identifier">assert_equal</span> <span class="ruby-string">'-'</span>, <span class="ruby-identifier">parsed</span>[<span class="ruby-value">:username</span>]
|
233
|
+
<span class="ruby-identifier">assert_equal</span> <span class="ruby-string">'21/Apr/2010:01:02:03 +0000'</span>, <span class="ruby-identifier">parsed</span>[<span class="ruby-value">:datetime</span>]
|
234
|
+
<span class="ruby-identifier">assert_equal</span> <span class="ruby-string">'GET /some/url?some=parameter HTTP/1.1'</span>, <span class="ruby-identifier">parsed</span>[<span class="ruby-value">:request</span>]
|
235
|
+
<span class="ruby-identifier">assert_equal</span> <span class="ruby-string">'302'</span>, <span class="ruby-identifier">parsed</span>[<span class="ruby-value">:status</span>]
|
236
|
+
<span class="ruby-identifier">assert_equal</span> <span class="ruby-string">'123'</span>, <span class="ruby-identifier">parsed</span>[<span class="ruby-value">:bytecount</span>]
|
237
|
+
<span class="ruby-identifier">assert_equal</span> <span class="ruby-string">'http://somewhere.com'</span>, <span class="ruby-identifier">parsed</span>[<span class="ruby-value">:referer</span>]
|
238
|
+
<span class="ruby-identifier">assert_equal</span> <span class="ruby-string">'Browser (Version 1.0)'</span>, <span class="ruby-identifier">parsed</span>[<span class="ruby-value">:user_agent</span>]
|
239
|
+
|
240
|
+
<span class="ruby-identifier">assert_equal</span> <span class="ruby-value">11</span>, <span class="ruby-identifier">parsed</span>.<span class="ruby-identifier">size</span>
|
241
|
+
|
242
|
+
<span class="ruby-keyword">end</span></pre>
|
243
|
+
</div><!-- test_simple_parsing-source -->
|
244
|
+
|
245
|
+
</div>
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
</div><!-- test_simple_parsing-method -->
|
251
|
+
|
252
|
+
|
253
|
+
</div><!-- public-instance-method-details -->
|
254
|
+
|
255
|
+
</div><!-- 5Buntitled-5D -->
|
256
|
+
|
257
|
+
|
258
|
+
</div><!-- documentation -->
|
259
|
+
|
260
|
+
<div id="validator-badges">
|
261
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
262
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
263
|
+
Rdoc Generator</a> 2</small>.</p>
|
264
|
+
</div>
|
265
|
+
|
266
|
+
</body>
|
267
|
+
</html>
|
268
|
+
|
@@ -0,0 +1,128 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
+
|
5
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
6
|
+
<head>
|
7
|
+
<meta content="text/html; charset=IBM437" http-equiv="Content-Type" />
|
8
|
+
|
9
|
+
<title>File: README.rdoc [RDoc Documentation]</title>
|
10
|
+
|
11
|
+
<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet" />
|
12
|
+
|
13
|
+
<script src="./js/jquery.js" type="text/javascript"
|
14
|
+
charset="utf-8"></script>
|
15
|
+
<script src="./js/thickbox-compressed.js" type="text/javascript"
|
16
|
+
charset="utf-8"></script>
|
17
|
+
<script src="./js/quicksearch.js" type="text/javascript"
|
18
|
+
charset="utf-8"></script>
|
19
|
+
<script src="./js/darkfish.js" type="text/javascript"
|
20
|
+
charset="utf-8"></script>
|
21
|
+
</head>
|
22
|
+
|
23
|
+
<body class="file">
|
24
|
+
<div id="metadata">
|
25
|
+
<div id="home-metadata">
|
26
|
+
<div id="home-section" class="section">
|
27
|
+
<h3 class="section-header">
|
28
|
+
<a href="./index.html">Home</a>
|
29
|
+
<a href="./index.html#classes">Classes</a>
|
30
|
+
<a href="./index.html#methods">Methods</a>
|
31
|
+
</h3>
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="project-metadata">
|
36
|
+
|
37
|
+
|
38
|
+
<div id="fileindex-section" class="section project-section">
|
39
|
+
<h3 class="section-header">Files</h3>
|
40
|
+
<ul>
|
41
|
+
|
42
|
+
<li class="file"><a href="./README_rdoc.html">README.rdoc</a></li>
|
43
|
+
|
44
|
+
<li class="file"><a href="./Rakefile.html">Rakefile</a></li>
|
45
|
+
|
46
|
+
</ul>
|
47
|
+
</div>
|
48
|
+
|
49
|
+
|
50
|
+
<div id="classindex-section" class="section project-section">
|
51
|
+
<h3 class="section-header">Class Index
|
52
|
+
<span class="search-toggle"><img src="./images/find.png"
|
53
|
+
height="16" width="16" alt="[+]"
|
54
|
+
title="show/hide quicksearch" /></span></h3>
|
55
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
56
|
+
<fieldset>
|
57
|
+
<legend>Quicksearch</legend>
|
58
|
+
<input type="text" name="quicksearch" value=""
|
59
|
+
class="quicksearch-field" />
|
60
|
+
</fieldset>
|
61
|
+
</form>
|
62
|
+
|
63
|
+
<ul class="link-list">
|
64
|
+
|
65
|
+
<li><a href="./Vizi.html">Vizi</a></li>
|
66
|
+
|
67
|
+
<li><a href="./Vizi/LogFormat.html">Vizi::LogFormat</a></li>
|
68
|
+
|
69
|
+
<li><a href="./Vizi/LogParser.html">Vizi::LogParser</a></li>
|
70
|
+
|
71
|
+
<li><a href="./Vizi/Visit.html">Vizi::Visit</a></li>
|
72
|
+
|
73
|
+
<li><a href="./Vizi/VisitList.html">Vizi::VisitList</a></li>
|
74
|
+
|
75
|
+
<li><a href="./Object.html">Object</a></li>
|
76
|
+
|
77
|
+
<li><a href="./ParserTest.html">ParserTest</a></li>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
81
|
+
</div>
|
82
|
+
|
83
|
+
|
84
|
+
</div>
|
85
|
+
</div>
|
86
|
+
|
87
|
+
<div id="documentation">
|
88
|
+
|
89
|
+
<h1>LogParser</h1>
|
90
|
+
|
91
|
+
<h2>Introduction</h2>
|
92
|
+
|
93
|
+
<p>This gem provides an easy to use parser to various HTTP log formats.</p>
|
94
|
+
|
95
|
+
<h2>Installation</h2>
|
96
|
+
|
97
|
+
<p>Just run:</p>
|
98
|
+
|
99
|
+
<pre>gem install http-log-parser</pre>
|
100
|
+
|
101
|
+
<p>That should take care of it.</p>
|
102
|
+
|
103
|
+
<h2>Usage</h2>
|
104
|
+
|
105
|
+
<pre>require 'http_log_parser'
|
106
|
+
parser = HttpLogParser.new
|
107
|
+
File.open('/path/to.log', 'r') do |file|
|
108
|
+
while(line = file.gets)
|
109
|
+
parsed_data = parser.parse_line(line)
|
110
|
+
p parsed_data
|
111
|
+
end
|
112
|
+
end</pre>
|
113
|
+
|
114
|
+
<h2>License</h2>
|
115
|
+
|
116
|
+
<p>This code is made availablie under the MIT license. It is based on based on
|
117
|
+
code from Jan Wikholm.</p>
|
118
|
+
|
119
|
+
</div>
|
120
|
+
|
121
|
+
<div id="validator-badges">
|
122
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
123
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
124
|
+
Rdoc Generator</a> 2</small>.</p>
|
125
|
+
</div>
|
126
|
+
</body>
|
127
|
+
</html>
|
128
|
+
|