fluent-plugin-anomalydetect 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +7 -0
- data/Gemfile.fluentd.lt.0.10.43 +4 -0
- data/Rakefile +1 -1
- data/fluent-plugin-anormalydetect.gemspec +1 -1
- data/lib/fluent/plugin/change_finder.rb +8 -3
- data/lib/fluent/plugin/out_anomalydetect.rb +6 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85a6c9f30ea4c80eba3c4bb42f02f28ad32d1ce7
|
4
|
+
data.tar.gz: af58f39de4592757c801d16fbf2fe3847d959cd5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd32d62aef8924d6df33e4cb09f89e87e531820bc1450a370c1184c07f0aa3ab7a2cda6c9fa1faf56b39d6bca99ee6aa263d935a3d65854acf85e07e05b104b5
|
7
|
+
data.tar.gz: 49b6bc57171e1223be3a3ce5a2f8370c4ebffc4cec794ca61b0890916664323c1291a4915a989b89d6e1ac09747bd78acd7293245d14e90cf8138e6fde607c71
|
data/.travis.yml
ADDED
data/Rakefile
CHANGED
@@ -3,7 +3,7 @@ lib = File.expand_path('../lib', __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
5
|
gem.name = "fluent-plugin-anomalydetect"
|
6
|
-
gem.version = "0.1.
|
6
|
+
gem.version = "0.1.5"
|
7
7
|
gem.authors = ["Muddy Dixon"]
|
8
8
|
gem.email = ["muddydixon@gmail.com"]
|
9
9
|
gem.description = %q{detect anomal sequential input casually}
|
@@ -1,6 +1,11 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
module Fluent
|
3
3
|
class ChangeFinder
|
4
|
+
# To support log_level option implemented by Fluentd v0.10.43
|
5
|
+
unless method_defined?(:log)
|
6
|
+
define_method("log") { $log }
|
7
|
+
end
|
8
|
+
|
4
9
|
require 'matrix'
|
5
10
|
attr_reader :mu
|
6
11
|
|
@@ -23,10 +28,10 @@ module Fluent
|
|
23
28
|
c = @sigma
|
24
29
|
for j in 0..(@term - 1)
|
25
30
|
if @data[len - 1 - j]
|
26
|
-
@c[j] = (1 - @r) * @c[j] + @r * (x - @mu) * (@data[len - 1 - j] - @mu)
|
31
|
+
@c[j] = (1 - @r) * @c[j] + @r * (x - @mu) * (@data[len - 1 - j] - @mu)
|
27
32
|
end
|
28
33
|
end
|
29
|
-
|
34
|
+
|
30
35
|
cc = Matrix.zero(@term).to_a
|
31
36
|
for j in 0..(@term - 1)
|
32
37
|
for i in j..(@term - 1)
|
@@ -46,7 +51,7 @@ module Fluent
|
|
46
51
|
|
47
52
|
p = prob(xt, @sigma, x)
|
48
53
|
s = score(p)
|
49
|
-
|
54
|
+
log.debug "change_finder:#{Thread.current.object_id} x:#{x} xt:#{xt} p:#{p} s:#{s} term:#{@term} r:#{@r} data:#{@data} mu:#{@mu} sigma:#{@sigma} c:#{@c}"
|
50
55
|
s
|
51
56
|
end
|
52
57
|
|
@@ -1,5 +1,11 @@
|
|
1
1
|
module Fluent
|
2
2
|
class AnomalyDetectOutput < Output
|
3
|
+
|
4
|
+
# To support log_level option implemented by Fluentd v0.10.43
|
5
|
+
unless method_defined?(:log)
|
6
|
+
define_method("log") { $log }
|
7
|
+
end
|
8
|
+
|
3
9
|
Fluent::Plugin.register_output('anomalydetect', self)
|
4
10
|
|
5
11
|
require_relative 'change_finder'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-anomalydetect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Muddy Dixon
|
@@ -74,7 +74,9 @@ extensions: []
|
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
76
|
- .gitignore
|
77
|
+
- .travis.yml
|
77
78
|
- Gemfile
|
79
|
+
- Gemfile.fluentd.lt.0.10.43
|
78
80
|
- README.md
|
79
81
|
- Rakefile
|
80
82
|
- fluent-plugin-anormalydetect.gemspec
|