log_analysis 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/log_analysis.rb +7 -1
- data/lib/log_analysis/preprocess.rb +1 -0
- data/lib/log_analysis/version.rb +1 -2
- 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: 4da3bc937c35f605da6c99b694104dab09af74be0f373a2537c990923e1c9bcb
|
4
|
+
data.tar.gz: b9ab4de5844da665fd5ac587c0404530971113208c82847f5b3130ad02d26764
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d477e49633b472c87f065317a107ab8423a3f0d2f6f7549bb3a35b36f4780f8a17bf58b58589fe0397329abc3e9a1181dd8bd099d0972808a3306be24fa7d7b6
|
7
|
+
data.tar.gz: cc4756d9bc8ed7199b9f9f1e67d3a0245dd7e2d511fe82b517eff5f0cc00bce89a84b7bd76842eeebd2ad3a354c0279e437dfee8e4973f3d29a66c194449e649
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
log_analysis (0.1.
|
4
|
+
log_analysis (0.1.3)
|
5
5
|
activesupport (~> 6.0.3.1)
|
6
6
|
useragent (~> 0.16.10)
|
7
7
|
|
@@ -17,7 +17,7 @@ GEM
|
|
17
17
|
concurrent-ruby (1.1.6)
|
18
18
|
i18n (1.8.3)
|
19
19
|
concurrent-ruby (~> 1.0)
|
20
|
-
minitest (5.
|
20
|
+
minitest (5.14.1)
|
21
21
|
rake (12.3.1)
|
22
22
|
thread_safe (0.3.6)
|
23
23
|
tzinfo (1.2.7)
|
data/lib/log_analysis.rb
CHANGED
@@ -15,7 +15,13 @@ class LogAnalysis
|
|
15
15
|
def initialize(path, type = nil)
|
16
16
|
@path = path
|
17
17
|
@type = type
|
18
|
-
@cleaned_data = PreProcess.input(path, type)
|
18
|
+
@cleaned_data = PreProcess.input(path, type) do |record|
|
19
|
+
if block_given?
|
20
|
+
yield(record) ? record : nil
|
21
|
+
else
|
22
|
+
record
|
23
|
+
end
|
24
|
+
end
|
19
25
|
end
|
20
26
|
|
21
27
|
def identified_user
|
@@ -19,6 +19,7 @@ module PreProcess
|
|
19
19
|
preprocessed_log = type.nil? ? line.gsub(/[\t]/i, ' ').chomp! : line
|
20
20
|
record_params = send(CONVERT_RECORD[type.nil? ? 'nginx' : type], preprocessed_log)
|
21
21
|
record = Record.new(record_params) if record_params && preprocessed_log
|
22
|
+
record = yield(record) if block_given?
|
22
23
|
|
23
24
|
arr.push(record) if record && record.status_200? && record.method_get? && record.uri_without_data && !record.robot?
|
24
25
|
|
data/lib/log_analysis/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: log_analysis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Tran
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: useragent
|