fluent-plugin-anomalydetect 0.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/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in fluent-plugin-anomalydetect.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 muddydixon
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,47 @@
1
+ # Fluent::Plugin::Anomalydetect
2
+
3
+ To detect anomaly for log stream, use this plugin.
4
+ Then you can find changes in logs casually.
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ gem 'fluent-plugin-anomalydetect'
11
+
12
+ And then execute:
13
+
14
+ $ bundle
15
+
16
+ Or install it yourself as:
17
+
18
+ $ gem install fluent-plugin-anomalydetect
19
+
20
+ ## Usage
21
+
22
+ ```
23
+ <source>
24
+ type file
25
+ ...
26
+ tag access.log
27
+ </source>
28
+
29
+ <match access.**>
30
+ type anomalydetect
31
+ tag anomaly.access
32
+ tick 86400
33
+ </match>
34
+
35
+ <match anomaly.access>
36
+ type file
37
+ ...
38
+ </match>
39
+ ```
40
+
41
+ Then the plugin output anomaly log counts in each day.
42
+
43
+ ## Theory
44
+ "データマイニングによる異常検知" http://amzn.to/XHXNun
45
+
46
+
47
+
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ require 'rake/testtask'
4
+ Rake::TestTask.new(:test) do |test|
5
+ test.libs << 'lib' << 'test'
6
+ test.pattern = 'test/**/test_*.rb'
7
+ test.verbose = true
8
+ end
9
+
10
+ task :default => :test
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.name = "fluent-plugin-anomalydetect"
6
+ gem.version = 0.0
7
+ gem.authors = ["Muddy Dixon"]
8
+ gem.email = ["muddydixon@gmail.com"]
9
+ gem.description = %q{detect anomal sequential input casually}
10
+ gem.summary = %q{detect anomal sequential input casually}
11
+ gem.homepage = "https://github.com/muddydixon/fluent-plugin-anomalydetect"
12
+
13
+
14
+ gem.files = `git ls-files`.split($/)
15
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
16
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
17
+ gem.require_paths = ["lib"]
18
+
19
+ gem.add_development_dependency "fluentd"
20
+ gem.add_runtime_dependency "fluentd"
21
+ end
@@ -0,0 +1,69 @@
1
+ # -*- coding: utf-8 -*-
2
+ module Fluent
3
+ class ChangeFinder
4
+ require 'matrix'
5
+
6
+ def initialize(term, r)
7
+ @term = term
8
+ @r = r
9
+ @data = []
10
+ @mu = 0
11
+ @sigma = 0
12
+ @c = (0..@term - 1).map do |i| rand end
13
+ end
14
+ def next(x)
15
+ len = @data.size
16
+
17
+ # update @mu
18
+ @mu = (1 - @r) * @mu + @r * x
19
+
20
+ # update @c
21
+ c = @sigma
22
+ for j in 0..@term - 1
23
+ if @data[len - 1 - j]
24
+ @c[j] = (1 - @r) * @c[j] + @r * (x - @mu) * (@data[len - 1 - j] - @mu)
25
+ end
26
+ end
27
+
28
+ cc = Matrix.zero(@term).to_a
29
+ for j in 0..(@term - 1)
30
+ for i in j..@term - 1
31
+ cc[j][i] = cc[i][j] = @c[i - j]
32
+ end
33
+ end
34
+ w = (Matrix.rows(cc).inv * Vector.elements(@c)).to_a
35
+ xt = @data.each.with_index.inject(@mu) do |sum, (v, idx)|
36
+ sum += w[idx] * (v - @mu)
37
+ end
38
+ @sigma = (1 - @r) * @sigma + @r * (x - xt) * (x - xt)
39
+
40
+ @data.push x
41
+ if @data.size > @term
42
+ @data.shift
43
+ end
44
+
45
+ score(prob xt, @sigma, x)
46
+ end
47
+
48
+ def prob (mu, sigma, v)
49
+ return 0 if sigma == 0
50
+
51
+ Math.exp( - 0.5 * (v - mu) ** 2 / sigma) / ((2 * Math::PI) ** 0.5 * sigma ** 0.5)
52
+ end
53
+
54
+ def score (p)
55
+ return 0 if p <= 0
56
+ -Math.log(p)
57
+ end
58
+
59
+ def smooth(size)
60
+ _end = @data.size
61
+ _begin = [_end - size, 0].max
62
+ @data.slice(_begin, _end).inject(0.0) do |sum, v| sum += v end / (_end - _begin)
63
+ end
64
+
65
+ def showStatus
66
+ {:sigma => @sigma, :mu => @mu, :data => @data, :c => @c}
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,139 @@
1
+ # -*- coding: utf-8 -*-
2
+ module Fluent
3
+ class AnomalyDetectOutput < Output
4
+ Fluent::Plugin.register_output('anomalydetect', self)
5
+
6
+ require 'fluent/plugin/change_finder'
7
+
8
+ config_param :outlier_term, :integer, :default => 28
9
+ config_param :outlier_discount, :float, :default => 0.05
10
+ config_param :smooth_term, :integer, :default => 7
11
+ config_param :score_term, :integer, :default => 14
12
+ config_param :score_discount, :float, :default => 0.1
13
+ config_param :tick, :integer, :default => 60 * 5
14
+ config_param :tag, :string, :default => "anomaly"
15
+ config_param :target, :string, :default => ""
16
+
17
+ attr_accessor :outlier
18
+ attr_accessor :score
19
+ attr_accessor :recordCount
20
+
21
+ attr_accessor :outliers
22
+
23
+ attr_accessor :records
24
+
25
+ def configure (conf)
26
+ super
27
+ unless 0 < @outlier_discount and @outlier_discount < 1
28
+ raise Fluent::ConfigError, "discount ratio should be between (0, 1)"
29
+ end
30
+ unless 0 < @score_discount and @score_discount < 1
31
+ raise Fluent::ConfigError, "discount ratio should be between (0, 1)"
32
+ end
33
+ if @outlier_term < 1
34
+ raise Fluent::ConfigError, "outlier term should be greater than 0"
35
+ end
36
+ if @score_term < 1
37
+ raise Fluent::ConfigError, "score term should be greater than 0"
38
+ end
39
+ if @smooth_term < 1
40
+ raise Fluent::ConfigError, "smooth term should be greater than 0"
41
+ end
42
+ if @tick < 1
43
+ raise Fluent::ConfigError, "tick timer should be greater than 1 sec"
44
+ end
45
+
46
+ @outliers = []
47
+ @outlier = ChangeFinder.new(@outlier_term, @outlier_discount)
48
+ @score = ChangeFinder.new(@score_term, @score_discount)
49
+
50
+ @records = []
51
+ @mutex = Mutex.new
52
+
53
+ if @target == ""
54
+ @recordCount = true
55
+ else
56
+ @recordCount = false
57
+ end
58
+ end
59
+
60
+ def start
61
+ super
62
+ init_records
63
+ start_watch
64
+ end
65
+
66
+ def shutdown
67
+ super
68
+ if @watcher
69
+ @watcher.terminate
70
+ @watcher.join
71
+ end
72
+ end
73
+
74
+ def start_watch
75
+ @watcher = Thread.new(&method(:watch))
76
+ end
77
+
78
+ def watch
79
+
80
+ @last_checked = Fluent::Engine.now
81
+ while true
82
+ sleep 0.5
83
+ if Fluent::Engine.now - @last_checked >= @tick
84
+ now = Fluent::Engine.now
85
+ flush_emit(now - @last_checked)
86
+ @last_checked = now
87
+ end
88
+ end
89
+ end
90
+
91
+ def init_records
92
+ @records = []
93
+ end
94
+
95
+ def flush_emit(step)
96
+ output = flush
97
+ Fluent::Engine.emit(@tag, Fluent::Engine.now, output)
98
+ end
99
+
100
+ def flush
101
+ flushed, @records = @records, init_records
102
+
103
+ val = 0
104
+ if @recordCount
105
+ val = flushed.size
106
+ else
107
+ val = flushed.inject(0.0) do |sum, record| sum += record[@target].to_f if record[@target]; end / flushed.size
108
+ end
109
+
110
+ outlier = @outlier.next(val)
111
+ @outliers.push outlier
112
+ @outliers.shift() if @outliers.size > @smooth_term
113
+ score = @score.next(@outliers.inject(0) do |sum, v| sum += v end / @outliers.size)
114
+
115
+ {"outlier" => outlier, "score" => score, "target" => val}
116
+
117
+ end
118
+
119
+ def tickTime (time)
120
+ (time - time % @tick).to_s
121
+ end
122
+
123
+ def pushRecords (records)
124
+ @mutex.synchronize do
125
+ @records.concat(records)
126
+ end
127
+ end
128
+
129
+ def emit (tag, es, chain)
130
+ records = []
131
+ es.each do |time, record|
132
+ records.push record
133
+ end
134
+ pushRecords records
135
+
136
+ chain.next
137
+ end
138
+ end
139
+ end
data/test/helper.rb ADDED
@@ -0,0 +1,28 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ begin
4
+ Bundler.setup(:default, :development)
5
+ rescue Bundler::BundlerError => e
6
+ $stderr.puts e.message
7
+ $stderr.puts "Run `bundle install` to install missing gems"
8
+ exit e.status_code
9
+ end
10
+ require 'test/unit'
11
+
12
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
13
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
14
+ require 'fluent/test'
15
+ unless ENV.has_key?('VERBOSE')
16
+ nulllogger = Object.new
17
+ nulllogger.instance_eval {|obj|
18
+ def method_missing(method, *args)
19
+ # pass
20
+ end
21
+ }
22
+ $log = nulllogger
23
+ end
24
+
25
+ require 'fluent/plugin/out_anomalydetect'
26
+
27
+ class Test::Unit::TestCase
28
+ end
@@ -0,0 +1,139 @@
1
+ require 'helper'
2
+
3
+ class AnomalyDetectOutputTest < Test::Unit::TestCase
4
+ def setup
5
+ Fluent::Test.setup
6
+ end
7
+
8
+ CONFIG = %[
9
+ tag test.anomaly
10
+ outlier_term 28
11
+ outlier_discount 0.05
12
+ score_term 28
13
+ score_discount 0.05
14
+ tick 10
15
+ smooth_term 3
16
+ target y
17
+ ]
18
+
19
+ def create_driver (conf=CONFIG, tag="debug.anomaly")
20
+ Fluent::Test::OutputTestDriver.new(Fluent::AnomalyDetectOutput, tag).configure(conf)
21
+ end
22
+
23
+ def test_configure
24
+ d = create_driver('')
25
+ assert_equal 28, d.instance.outlier_term
26
+ assert_equal 0.05, d.instance.outlier_discount
27
+ assert_equal 7, d.instance.smooth_term
28
+ assert_equal 14, d.instance.score_term
29
+ assert_equal 0.1, d.instance.score_discount
30
+ assert_equal 300, d.instance.tick
31
+ assert_equal "", d.instance.target
32
+ assert_equal true, d.instance.recordCount
33
+
34
+ d = create_driver
35
+ assert_equal 28, d.instance.outlier_term
36
+ assert_equal 0.05, d.instance.outlier_discount
37
+ assert_equal 3, d.instance.smooth_term
38
+ assert_equal 28, d.instance.score_term
39
+ assert_equal 0.05, d.instance.score_discount
40
+ assert_equal 10, d.instance.tick
41
+ assert_equal "y", d.instance.target
42
+ assert_equal 'test.anomaly', d.instance.tag
43
+ assert_equal false, d.instance.recordCount
44
+
45
+ assert_raise(Fluent::ConfigError) {
46
+ d = create_driver %[
47
+ outlier_discount 1.3
48
+ ]
49
+ }
50
+ assert_raise(Fluent::ConfigError) {
51
+ d = create_driver %[
52
+ score_discount 1.3
53
+ ]
54
+ }
55
+ assert_raise(Fluent::ConfigError) {
56
+ d = create_driver %[
57
+ outlier_discount -0.3
58
+ ]
59
+ }
60
+ assert_raise(Fluent::ConfigError) {
61
+ d = create_driver %[
62
+ score_discount -0.3
63
+ ]
64
+ }
65
+ assert_raise(Fluent::ConfigError) {
66
+ d = create_driver %[
67
+ outlier_term 0
68
+ ]
69
+ }
70
+ assert_raise(Fluent::ConfigError) {
71
+ d = create_driver %[
72
+ score_term 0
73
+ ]
74
+ }
75
+ assert_raise(Fluent::ConfigError) {
76
+ d = create_driver %[
77
+ smooth_term 0
78
+ ]
79
+ }
80
+ assert_raise(Fluent::ConfigError) {
81
+ d = create_driver %[
82
+ tick 0
83
+ ]
84
+ }
85
+ end
86
+
87
+ def test_array_init
88
+ d = create_driver
89
+ assert_equal [], d.instance.outliers
90
+ assert_equal [], d.instance.records
91
+ end
92
+
93
+ def test_sdar
94
+ d = create_driver
95
+ assert_instance_of Fluent::ChangeFinder, d.instance.outlier
96
+ assert_instance_of Fluent::ChangeFinder, d.instance.score
97
+ end
98
+
99
+ def test_emit_record_count
100
+ d = create_driver %[
101
+ tag test.anomaly
102
+ outlier_term 28
103
+ outlier_discount 0.05
104
+ score_term 28
105
+ score_discount 0.05
106
+ tick 10
107
+ smooth_term 3
108
+ ]
109
+
110
+ data = (0..10).map do || (rand * 100).to_i end
111
+ data.push 0
112
+ d.run do
113
+ data.each do |val|
114
+ (0..val - 1).each do ||
115
+ d.emit({'y' => 1})
116
+ end
117
+ r = d.instance.flush
118
+ assert_equal val, r['target']
119
+ end
120
+ end
121
+ end
122
+
123
+ def test_emit_stock_data
124
+ require 'csv'
125
+ reader = CSV.open("test/stock.2432.csv", "r")
126
+ header = reader.take(1)[0]
127
+ d = create_driver
128
+ d.run do
129
+ reader.each_with_index do |row, idx|
130
+ break if idx > 5
131
+ d.emit({'y' => row[4].to_i})
132
+ r = d.instance.flush
133
+ assert r['target']
134
+ assert r['outlier']
135
+ assert r['score']
136
+ end
137
+ end
138
+ end
139
+ end
@@ -0,0 +1,262 @@
1
+ x,s,M,m,y,o
2
+ 20110104,2914,2978,2906,2969,1379000
3
+ 20110105,2990,2995,2914,2931,1521100
4
+ 20110106,2949,2952,2919,2932,1086300
5
+ 20110107,2922,2969,2912,2917,1216000
6
+ 20110111,2924,2965,2919,2957,1369100
7
+ 20110112,2958,3045,2957,3025,2080700
8
+ 20110113,3050,3055,2973,3035,1570800
9
+ 20110114,3035,3095,2993,3030,2167700
10
+ 20110117,3055,3060,2970,2985,1311800
11
+ 20110118,2962,2967,2920,2940,1416800
12
+ 20110119,2951,2976,2920,2972,1357100
13
+ 20110120,2967,2985,2873,2902,2164300
14
+ 20110121,2865,2896,2706,2780,3223900
15
+ 20110124,2764,2812,2752,2778,1596100
16
+ 20110125,2759,2809,2750,2785,1616800
17
+ 20110126,2787,2901,2770,2897,2419200
18
+ 20110127,2950,2989,2932,2979,2768300
19
+ 20110128,2967,3010,2950,3005,2234200
20
+ 20110131,2935,3020,2918,2959,1434700
21
+ 20110201,3010,3145,2993,3100,4213100
22
+ 20110202,2989,3030,2925,2926,7932000
23
+ 20110203,2937,2957,2858,2890,2932700
24
+ 20110204,2872,2928,2852,2859,2080900
25
+ 20110207,2865,2909,2860,2878,1276800
26
+ 20110208,2907,2924,2840,2849,1858700
27
+ 20110209,2869,2872,2819,2862,1738000
28
+ 20110210,2872,2924,2850,2912,1878000
29
+ 20110214,2899,2916,2884,2907,1030300
30
+ 20110215,2922,3020,2915,3015,3603200
31
+ 20110216,3050,3070,3000,3040,2737100
32
+ 20110217,2991,3060,2970,3030,1493400
33
+ 20110218,3005,3070,2996,3055,1921200
34
+ 20110221,3080,3255,3080,3250,5817200
35
+ 20110222,3235,3240,3150,3150,2419800
36
+ 20110223,3095,3225,3085,3135,2376000
37
+ 20110224,3130,3150,3030,3040,2173700
38
+ 20110225,2998,3045,2970,3020,2799300
39
+ 20110228,3040,3175,3035,3155,2501700
40
+ 20110301,3185,3200,3150,3190,1605800
41
+ 20110302,3115,3215,3110,3150,1901200
42
+ 20110303,3175,3310,3165,3270,4072800
43
+ 20110304,3335,3350,3240,3275,2222900
44
+ 20110307,3280,3360,3255,3290,1993200
45
+ 20110308,3285,3320,3260,3280,1639200
46
+ 20110309,3330,3335,3245,3290,1777100
47
+ 20110310,3260,3280,3210,3260,1769400
48
+ 20110311,3190,3230,3150,3170,1913000
49
+ 20110314,2860,3040,2797,2815,4323000
50
+ 20110315,2730,2800,2490,2655,5408700
51
+ 20110316,2790,2904,2760,2852,3199900
52
+ 20110317,2762,3000,2753,2967,2674100
53
+ 20110318,2989,3030,2904,2936,1998100
54
+ 20110322,3060,3070,2973,3010,1597400
55
+ 20110323,2999,3110,2971,3035,1754400
56
+ 20110324,3035,3165,3030,3145,2141800
57
+ 20110325,3175,3205,3115,3145,2021100
58
+ 20110328,3115,3120,2994,3020,1504700
59
+ 20110329,2996,3050,2980,3005,1415100
60
+ 20110330,3000,3075,3000,3020,1783900
61
+ 20110331,3020,3040,2956,3005,2226700
62
+ 20110401,3015,3045,2986,2986,1644900
63
+ 20110404,2999,3020,2987,3005,975500
64
+ 20110405,3010,3010,2875,2889,1838900
65
+ 20110406,2900,2918,2837,2882,1293100
66
+ 20110407,2924,2998,2910,2939,1683800
67
+ 20110408,2925,2980,2901,2970,1083400
68
+ 20110411,2993,3020,2970,2981,1065800
69
+ 20110412,2965,2984,2871,2890,1512300
70
+ 20110413,2876,2945,2815,2871,2040800
71
+ 20110414,2867,2869,2817,2853,1759100
72
+ 20110415,2868,2898,2831,2852,1568200
73
+ 20110418,2855,2873,2820,2820,1217700
74
+ 20110419,2791,2798,2740,2748,1696500
75
+ 20110420,2770,2819,2725,2726,3476700
76
+ 20110421,2754,2798,2741,2785,2346600
77
+ 20110422,2805,2855,2786,2836,2522300
78
+ 20110425,2855,2892,2816,2831,1657100
79
+ 20110426,2910,3005,2906,2988,5475500
80
+ 20110427,2989,3020,2956,3000,2510500
81
+ 20110428,3005,3030,2966,3025,2697600
82
+ 20110502,2970,2989,2857,2866,6418500
83
+ 20110506,2817,2865,2776,2804,3688800
84
+ 20110509,2777,2808,2759,2791,2509300
85
+ 20110510,2783,2861,2783,2843,2327700
86
+ 20110511,2855,2898,2846,2891,2577500
87
+ 20110512,2878,2924,2865,2891,2603200
88
+ 20110513,2909,2918,2811,2827,1619700
89
+ 20110516,2812,2846,2776,2783,1116400
90
+ 20110517,2768,2821,2752,2808,1556800
91
+ 20110518,2800,2860,2798,2840,939100
92
+ 20110519,2885,2911,2863,2906,2369500
93
+ 20110520,2900,2945,2870,2883,2247900
94
+ 20110523,2879,2890,2806,2852,1609700
95
+ 20110524,2832,2934,2829,2924,1806700
96
+ 20110525,2939,2959,2893,2924,1525200
97
+ 20110526,2820,2856,2791,2818,7961100
98
+ 20110527,2853,2886,2838,2868,2808400
99
+ 20110530,2870,2873,2829,2837,2032900
100
+ 20110531,2835,2885,2821,2885,2953500
101
+ 20110601,2923,3050,2908,3050,5114700
102
+ 20110602,3010,3080,2981,3045,3222100
103
+ 20110603,3060,3080,2991,3035,2027800
104
+ 20110606,3030,3150,3020,3130,2989800
105
+ 20110607,3155,3175,3105,3170,2845300
106
+ 20110608,3140,3275,3135,3265,3878000
107
+ 20110609,3200,3255,3165,3205,2879000
108
+ 20110610,3150,3220,3105,3150,2851500
109
+ 20110613,3120,3235,3105,3230,2363200
110
+ 20110614,3230,3345,3225,3240,4376800
111
+ 20110615,3215,3220,3150,3185,2041000
112
+ 20110616,3155,3220,3130,3130,1423000
113
+ 20110617,3300,3325,3235,3240,4231300
114
+ 20110620,3310,3340,3200,3250,2633200
115
+ 20110621,3295,3455,3290,3440,4401300
116
+ 20110622,3490,3510,3430,3455,2961400
117
+ 20110623,3520,3545,3405,3425,2430000
118
+ 20110624,3425,3430,3285,3360,2639300
119
+ 20110627,3360,3405,3325,3350,1244400
120
+ 20110628,3325,3360,3290,3300,1298300
121
+ 20110629,3365,3470,3355,3450,2755000
122
+ 20110630,3455,3480,3400,3455,1821500
123
+ 20110701,3450,3475,3410,3425,1310100
124
+ 20110704,3500,3520,3440,3460,1232100
125
+ 20110705,3490,3495,3450,3485,866400
126
+ 20110706,3500,3515,3450,3500,928100
127
+ 20110707,3510,3605,3495,3595,2170600
128
+ 20110708,3665,3800,3660,3785,4691500
129
+ 20110711,3775,3865,3725,3755,3158200
130
+ 20110712,3795,3815,3680,3690,2665900
131
+ 20110713,3700,3835,3695,3825,2636500
132
+ 20110714,3890,4025,3865,4025,5563300
133
+ 20110715,4000,4020,3895,3920,3766600
134
+ 20110719,3855,3910,3815,3820,3735400
135
+ 20110720,3870,3895,3825,3835,1651900
136
+ 20110721,3860,3945,3855,3940,2109200
137
+ 20110722,3985,4000,3910,3940,1966300
138
+ 20110725,3935,3980,3920,3950,1201100
139
+ 20110726,3985,4055,3955,4050,3881600
140
+ 20110727,4025,4070,3975,3995,2057200
141
+ 20110728,3955,4055,3890,3955,2461500
142
+ 20110729,3935,3960,3795,3845,2868700
143
+ 20110801,3805,4025,3805,3960,2637700
144
+ 20110802,3920,4045,3920,4020,3095900
145
+ 20110803,3970,4000,3910,3960,2052300
146
+ 20110804,4070,4090,3900,3915,3133100
147
+ 20110805,3795,3985,3660,3985,4110100
148
+ 20110808,3920,3930,3595,3635,6041600
149
+ 20110809,3550,3705,3450,3640,6167500
150
+ 20110810,3780,3870,3705,3800,4560200
151
+ 20110811,3730,3945,3685,3945,5398400
152
+ 20110812,3940,3965,3840,3890,3894800
153
+ 20110815,3890,3930,3815,3910,2538600
154
+ 20110816,3915,4150,3895,4040,6665100
155
+ 20110817,4110,4185,4015,4135,5588600
156
+ 20110818,4185,4330,4155,4255,8056300
157
+ 20110819,4115,4210,4015,4030,6759900
158
+ 20110822,4100,4150,3765,3780,5888500
159
+ 20110823,3785,3860,3600,3775,8136200
160
+ 20110824,3845,3850,3555,3580,5260500
161
+ 20110825,3585,3655,3500,3530,5926300
162
+ 20110826,3580,3780,3555,3775,5545000
163
+ 20110829,3810,3935,3785,3920,5392600
164
+ 20110830,3920,4040,3880,4005,4572100
165
+ 20110831,4070,4070,3910,3960,4496300
166
+ 20110901,4000,4010,3925,3960,2999100
167
+ 20110902,3970,4055,3950,4030,4258900
168
+ 20110905,3980,4050,3965,3965,3150300
169
+ 20110906,3905,3915,3655,3700,4819200
170
+ 20110907,3840,4010,3815,3995,5131500
171
+ 20110908,4040,4040,3815,3915,4423100
172
+ 20110909,3930,3980,3835,3885,2635000
173
+ 20110912,3745,3905,3730,3815,2946000
174
+ 20110913,3840,3935,3760,3850,3049600
175
+ 20110914,3825,3910,3720,3745,2772700
176
+ 20110915,3820,3830,3595,3615,3546300
177
+ 20110916,3655,3755,3580,3740,3091400
178
+ 20110920,3690,3730,3555,3585,2840100
179
+ 20110921,3545,3590,3450,3455,3331700
180
+ 20110922,3360,3425,3230,3245,4986400
181
+ 20110926,3255,3345,3230,3290,4330000
182
+ 20110927,3360,3370,3080,3190,4788000
183
+ 20110928,3185,3360,3175,3300,4141600
184
+ 20110929,3260,3380,3230,3350,3908500
185
+ 20110930,3335,3345,3210,3270,3186900
186
+ 20111003,3190,3325,3180,3220,2449200
187
+ 20111004,3175,3305,3175,3265,3160900
188
+ 20111005,3430,3545,3410,3530,7924400
189
+ 20111006,3530,3610,3480,3555,3090200
190
+ 20111007,3560,3605,3515,3600,1896400
191
+ 20111011,3660,3670,3535,3540,1835000
192
+ 20111012,3525,3525,3390,3405,1977000
193
+ 20111013,3390,3535,3365,3510,2241000
194
+ 20111014,3515,3580,3465,3495,1564700
195
+ 20111017,3540,3555,3485,3490,1119000
196
+ 20111018,3470,3490,3335,3405,1254900
197
+ 20111019,3300,3340,3125,3135,5804200
198
+ 20111020,3200,3250,3140,3180,3698900
199
+ 20111021,3175,3210,3060,3105,2284600
200
+ 20111024,3075,3230,3020,3215,2450400
201
+ 20111025,3200,3240,3140,3180,1358400
202
+ 20111026,3185,3235,3155,3215,1121800
203
+ 20111027,3185,3315,3150,3290,2582900
204
+ 20111028,3335,3415,3275,3340,3205100
205
+ 20111031,3365,3510,3365,3425,2603900
206
+ 20111101,2725,2884,2725,2725,24491800
207
+ 20111102,2649,2708,2572,2640,17998500
208
+ 20111104,2640,2667,2510,2627,14766700
209
+ 20111107,2658,2777,2652,2759,14467300
210
+ 20111108,2790,2831,2694,2731,12980300
211
+ 20111109,2734,2757,2662,2707,5999100
212
+ 20111110,2652,2776,2642,2762,6639700
213
+ 20111111,2750,2783,2736,2762,3749300
214
+ 20111114,2794,2819,2758,2786,3658500
215
+ 20111115,2790,2800,2752,2781,2722300
216
+ 20111116,2762,2766,2668,2670,4120300
217
+ 20111117,2650,2713,2616,2651,3286100
218
+ 20111118,2604,2648,2578,2627,3266300
219
+ 20111121,2560,2594,2285,2302,11355900
220
+ 20111122,2152,2310,2104,2229,16013500
221
+ 20111124,2250,2310,2173,2181,6894800
222
+ 20111125,2162,2270,2150,2215,5068300
223
+ 20111128,2255,2298,2220,2267,3058700
224
+ 20111129,2280,2346,2270,2309,4831400
225
+ 20111130,2324,2378,2315,2357,3798700
226
+ 20111201,2399,2414,2296,2330,5295400
227
+ 20111202,2412,2528,2410,2519,9853900
228
+ 20111205,2558,2563,2476,2519,5885100
229
+ 20111206,2500,2531,2446,2450,4426100
230
+ 20111207,2472,2509,2446,2484,3075600
231
+ 20111208,2450,2479,2412,2424,3698700
232
+ 20111209,2390,2419,2376,2392,2761100
233
+ 20111212,2411,2445,2397,2413,2608100
234
+ 20111213,2395,2405,2345,2378,2478400
235
+ 20120223,2613,2637,2573,2587,3856400
236
+ 20120224,2531,2647,2520,2638,7743200
237
+ 20120316,2273,2296,2227,2244,7611000
238
+ 20120319,2245,2270,2160,2167,5324000
239
+ 20120321,2187,2280,2179,2236,8134000
240
+ 20120322,2268,2288,2233,2259,5919700
241
+ 20120323,2262,2283,2231,2260,3544800
242
+ 20120326,2268,2277,2146,2199,7376500
243
+ 20120327,2200,2264,2168,2247,4001700
244
+ 20120328,2192,2247,2178,2202,2892200
245
+ 20120329,2232,2355,2230,2340,6893700
246
+ 20120330,2305,2320,2248,2293,6171500
247
+ 20120402,2354,2384,2340,2371,4993400
248
+ 20120403,2350,2371,2274,2321,5195300
249
+ 20120404,2358,2417,2344,2393,7283400
250
+ 20120405,2393,2432,2335,2393,6148800
251
+ 20120406,2416,2430,2365,2384,4419100
252
+ 20120409,2359,2419,2340,2390,3065200
253
+ 20120410,2375,2390,2291,2302,3968700
254
+ 20120411,2286,2381,2256,2377,4988300
255
+ 20120412,2381,2425,2356,2413,4470100
256
+ 20120413,2401,2469,2383,2422,4478700
257
+ 20120416,2408,2429,2393,2406,1897500
258
+ 20120417,2415,2526,2406,2519,6338900
259
+ 20120418,2510,2545,2474,2521,4773300
260
+ 20120419,2521,2592,2510,2549,4322200
261
+ 20120420,2533,2575,2491,2539,3876000
262
+ 20120423,2544,2643,2544,2635,5467000
metadata ADDED
@@ -0,0 +1,81 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fluent-plugin-anomalydetect
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.0'
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Muddy Dixon
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-01-11 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: fluentd
16
+ requirement: &2152223980 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: *2152223980
25
+ - !ruby/object:Gem::Dependency
26
+ name: fluentd
27
+ requirement: &2152223420 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *2152223420
36
+ description: detect anomal sequential input casually
37
+ email:
38
+ - muddydixon@gmail.com
39
+ executables: []
40
+ extensions: []
41
+ extra_rdoc_files: []
42
+ files:
43
+ - .gitignore
44
+ - Gemfile
45
+ - LICENSE.txt
46
+ - README.rdoc
47
+ - Rakefile
48
+ - fluent-plugin-anormalydetect.gemspec
49
+ - lib/fluent/plugin/change_finder.rb
50
+ - lib/fluent/plugin/out_anomalydetect.rb
51
+ - test/helper.rb
52
+ - test/plugin/test_out_anomalydetect.rb
53
+ - test/stock.2432.csv
54
+ homepage: https://github.com/muddydixon/fluent-plugin-anomalydetect
55
+ licenses: []
56
+ post_install_message:
57
+ rdoc_options: []
58
+ require_paths:
59
+ - lib
60
+ required_ruby_version: !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ required_rubygems_version: !ruby/object:Gem::Requirement
67
+ none: false
68
+ requirements:
69
+ - - ! '>='
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ requirements: []
73
+ rubyforge_project:
74
+ rubygems_version: 1.8.11
75
+ signing_key:
76
+ specification_version: 3
77
+ summary: detect anomal sequential input casually
78
+ test_files:
79
+ - test/helper.rb
80
+ - test/plugin/test_out_anomalydetect.rb
81
+ - test/stock.2432.csv