fluent-plugin-sampling-filter 1.0.0 → 1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4bb5bf2e2842f56be230defcabebf6574271d6c6
4
- data.tar.gz: 54962ccbd36c5c0d502e7bbb0e79fc45748c545d
3
+ metadata.gz: 649911c9296c2b6a15a2a4a24a9762a577be6c40
4
+ data.tar.gz: 2449647d5f8aedc8516d8dc3777aad753a956262
5
5
  SHA512:
6
- metadata.gz: ccd41752621ecfa648e8e2427517fb68c19e9a0b1ea8e0569c81145b82e15d971e6aab52debd2bcdf458e6fff2c4eb71b2e3d3b0448cfc9b21ec512a4bbb2d0e
7
- data.tar.gz: 8dcc45ffd1bec441e39882accb4fde2e0290ff183e669f67b26efa96e95c8b61957279f9cff89f05049469d946517092b97c1ebfc06767fe1d07a766409dfae8
6
+ metadata.gz: 30583bdb0e00e4e99f4eccc342fa52989c652b88e0f9cfc2eab0c214e67620f826fc4e231ca02635b66f36d455854ec647bef7e2ad4e1856a8c81463260947c2
7
+ data.tar.gz: cbcfb440312c6925cc2a7857f0c445265c12c60471fd5f1f99ff4a4828d46f5c60c686f5b17e8f3c35e72b6e9fefaf3f8580969423c01079b4bc47697d0642cf
data/README.md CHANGED
@@ -1,18 +1,56 @@
1
1
  # fluent-plugin-sampling-filter
2
2
 
3
- ## Component
4
-
5
- ### SamplingFilterOutput
6
-
7
3
  This is a [Fluentd](http://fluentd.org) plugin to sample matching messages to analyse and report messages behavior and emit sampled messages with modified tag.
8
4
 
9
5
  * sampling rate per tags, or for all
10
- * remove_prefix of tags for input messages, and add_prefix of tags for output(sampled) messages
11
6
 
12
7
  ## Configuration
13
8
 
9
+ ### SamplingFilter
10
+
11
+ This filter passes a specified part of whole events to following filter/output plugins:
12
+
13
+ <source>
14
+ @type any_great_input
15
+ @label @mydata
16
+ </source>
17
+
18
+ <label @mydata>
19
+ <filter **>
20
+ @type sampling
21
+ interval 10 # pass 1/10 events to following plugins
22
+ </filter>
23
+
24
+ <match **>
25
+ @type ...
26
+ </match>
27
+ </label>
28
+
29
+ Sampling is done for all events, but we can do it per matched tags:
30
+
31
+ <source>
32
+ @type any_great_input
33
+ @label @mydata
34
+ </source>
35
+
36
+ <label @mydata>
37
+ <filter **>
38
+ @type sampling
39
+ interval 10
40
+ sample_unit tag # 1/10 events for each tags
41
+ </filter>
42
+
43
+ <match **>
44
+ @type ...
45
+ </match>
46
+ </label>
47
+
48
+ `minimum_rate_per_min` option(integer) configures this plugin to pass events with the specified rate even how small is the total number of whole events.
49
+
14
50
  ### SamplingFilterOutput
15
51
 
52
+ **NOTE: This plugin is deprecated. Use filter plugin instead.**
53
+
16
54
  Pickup 1/10 messages about each tags(default: `sample_unit tag`), and add tag prefix `sampled`.
17
55
 
18
56
  <match **>
@@ -41,7 +79,6 @@ Pickup 1/100 messages of all matched messages, and modify tags from `input.**` t
41
79
 
42
80
  ## TODO
43
81
 
44
- * consider what to do next
45
82
  * patches welcome!
46
83
 
47
84
  ## Copyright
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = "fluent-plugin-sampling-filter"
5
- gem.version = "1.0.0"
5
+ gem.version = "1.1.0"
6
6
  gem.authors = ["TAGOMORI Satoshi"]
7
7
  gem.email = ["tagomoris@gmail.com"]
8
8
  gem.description = %q{fluentd plugin to pickup sample data from matched massages}
@@ -2,6 +2,7 @@ require 'fluent/plugin/filter'
2
2
  require 'fluent/clock'
3
3
 
4
4
  class Fluent::Plugin::SamplingFilter < Fluent::Plugin::Filter
5
+ Fluent::Plugin.register_filter('sampling', self)
5
6
  Fluent::Plugin.register_filter('sampling_filter', self)
6
7
 
7
8
  config_param :interval, :integer
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-sampling-filter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - TAGOMORI Satoshi