fluent-plugin-redis-store-wejick 0.0.8 → 0.0.9

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: 70737670280e0eeb33bb3563447e49d4a775496b
4
- data.tar.gz: 41f7932b44117c1fc7bcf1e1575d176307afaadf
3
+ metadata.gz: 5c15a86a6dd606a7ed86a89c87ba70a3b6f15bcd
4
+ data.tar.gz: e28380c9597f85e075822e7a36d2f252c073c5ea
5
5
  SHA512:
6
- metadata.gz: 144e9b8ac10e86e241bdb749bf9e6c6df1abeb7a2e455974ed885be7c19a631a1ac48de94a0cb95f2c4fe034062166346a5bc2cee4948d34f884c7155e20ba76
7
- data.tar.gz: 7c095e45d1a9aa869cebe6768b9eac8ce2c53788cba8311acdc63b6ae9bde039c94bac9ace51a0ba198d2aa8855c219e6dc82d51b136318b3a5fccce7bf7741a
6
+ metadata.gz: 9c4169b5a38611d35a56ac43cd779d85c22cd652277411d271b38ba1c03c07d7a2cddf746a28ad5e17e073ac40873c07a40f7f6be77a270e5456157a10f15b3f
7
+ data.tar.gz: 13fc9df9c479e60e4ce426e80b90d2b32623594c99c5508f2ac2ab93f3a552eb276e7d3972d2a87d0911709f7362a73334e52ef41294181f8baec1ff48a2afca
data/README.md CHANGED
@@ -9,6 +9,7 @@ Background
9
9
  ----------
10
10
 
11
11
  Forked from redis-store which forked from redisstore plugin
12
+ I'm using this in high traffic production environment
12
13
 
13
14
  Features
14
15
  --------
@@ -121,14 +122,16 @@ No more options than common options.
121
122
 
122
123
  ### `list` storage specific options
123
124
 
124
- | Key | Type | Default | Description |
125
- | :---- | :----- | :----------------------- | :------------ |
126
- | `order` | string | asc | `asc`: **rpush**, `desc`: **lpush** |
127
- | `prevent_duplicate` | (0,1) | 0 | Prevent duplicated value in one key (list) |
128
- | `string_tolow` | (0,1) | 0 | value to lowercase |
129
- | `string_unescape` | (0,1) | 0 | unescape value |
130
- | `string_unescape_twice` | (0,1) | 0 | in you need another unescape |
131
- | `value_length` | (0,1) | list trimming doesn't honor ordering |
125
+ | Key | Type | Default | Description |
126
+ | :------------------ | :----- | :----------- | :------------ |
127
+ | `order` | string | asc | `asc`: **rpush**, `desc`: **lpush** |
128
+ | `prevent_duplicate` | (0,1) | 0 | Prevent duplicated value in one key (list) |
129
+ | `string_tolow` | (0,1) | 0 | value to lowercase |
130
+ | `string_unescape` | (0,1) | 0 | unescape value |
131
+ | `string_unescape_twice` | (0,1) | 0 | if you need another unescape |
132
+ | `escape_html_tag` | (0,1) | 0 | escape html tag |
133
+ | `filter_html_tag` | (0,1) | 0 | replace <>'"& with empty character |
134
+ | `value_length` | (0,1) | | list trimming doesn't honor ordering |
132
135
 
133
136
  ### `set` storage specific options
134
137
 
@@ -136,15 +139,17 @@ No more options than common options.
136
139
 
137
140
  ### `zset` storage specific options
138
141
 
139
- | Key | Type | Default | Description |
140
- | :---- | :----- | :----------------------- | :------------ |
141
- | `score_path` | string | (_time_ of log event) | path to lookup for _score_ in the event data |
142
- | `value_expire` | int | | value expiration in seconds |
143
- | `prevent_duplicate` | (0,1) | 0 | Prevent duplicated value in one key (list) |
144
- | `string_tolow` | (0,1) | 0 | value to lowercase |
145
- | `string_unescape` | (0,1) | 0 | unescape value |
146
- | `string_unescape_twice` | (0,1) | 0 | in you need another unescape |
147
- | `value_length` | (0,1) | z trimming doesn't honor ordering |
142
+ | Key | Type | Default | Description |
143
+ | :---- | :----- | :----------------------- | :------------ |
144
+ | `score_path` | string | (_time_ of log event) | path to lookup for _score_ in the event data |
145
+ | `value_expire` | int | | value expiration in seconds |
146
+ | `prevent_duplicate` | (0,1) | 0 | Prevent duplicated value in one key (list) |
147
+ | `string_tolow` | (0,1) | 0 | value to lowercase |
148
+ | `string_unescape` | (0,1) | 0 | unescape value |
149
+ | `string_unescape_twice` | (0,1) | 0 | in you need another unescape |
150
+ | `escape_html_tag` | (0,1) | 0 | escape html tag |
151
+ | `filter_html_tag` | (0,1) | 0 | replace <>'"& with empty character |
152
+ | `value_length` | (0,1) | | z trimming doesn't honor ordering |
148
153
 
149
154
  If `value_expire` is set, the plugin assumes that the _score_ in the **SortedSet** is
150
155
  based on *timestamp* and it deletes expired _members_ every after new event data arrives.
@@ -2,7 +2,7 @@
2
2
  Gem::Specification.new do |gem|
3
3
  gem.name = "fluent-plugin-redis-store-wejick"
4
4
  gem.email = "wejick@gmail.com"
5
- gem.version = "0.0.8"
5
+ gem.version = "0.0.9"
6
6
  gem.authors = ["wejick", "Gian Giovani"]
7
7
  gem.licenses = ["Apache-2.0"]
8
8
  gem.summary = %q{Redis(zset/set/list/string/publish) output plugin for Fluentd}
@@ -28,6 +28,8 @@ module Fluent
28
28
  config_param :string_tolow, :integer, :default => 0
29
29
  config_param :string_unescape, :integer, :default => 0
30
30
  config_param :string_unescape_twice, :integer, :default => 0
31
+ config_param :string_escape_html,:integer, :default => 0
32
+ config_param :filter_html, :integer, :default => 0
31
33
 
32
34
  def initialize
33
35
  super
@@ -107,6 +109,12 @@ module Fluent
107
109
  value = unescape_string(value)
108
110
  end
109
111
  end
112
+ if 0 < @string_escape_html
113
+ value = escape_html(value)
114
+ end
115
+ if 0 < @filter_html
116
+ value = filter_html_tag(value)
117
+ end
110
118
  if 0 < @only_alphanumeric
111
119
  if ( /^[a-zA-Z0-9 ]*$/.match(value) ) != nil
112
120
  else
@@ -147,6 +155,12 @@ module Fluent
147
155
  value = unescape_string(value)
148
156
  end
149
157
  end
158
+ if 0 < @string_escape_html
159
+ value = escape_html(value)
160
+ end
161
+ if 0 < @filter_html
162
+ value = filter_html_tag(value)
163
+ end
150
164
  if 0 < @only_alphanumeric
151
165
  if ( /^[a-zA-Z0-9 ]*$/.match(value) ) != nil
152
166
  else
@@ -190,6 +204,20 @@ module Fluent
190
204
  return string
191
205
  end
192
206
 
207
+ def escape_html(string)
208
+ string = CGI::escapeHTML(string)
209
+ return string
210
+ end
211
+
212
+ def filter_html_tag(string)
213
+ string = string.gsub("&","")
214
+ string = string.gsub("<","")
215
+ string = string.gsub(">","")
216
+ string = string.gsub("'","")
217
+ string = string.gsub("\"","")
218
+ return string
219
+ end
220
+
193
221
  def traverse(data, key)
194
222
  val = data
195
223
  key.split('.').each{ |k|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-redis-store-wejick
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - wejick
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-09-01 00:00:00.000000000 Z
12
+ date: 2016-12-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  version: '0'
102
102
  requirements: []
103
103
  rubyforge_project:
104
- rubygems_version: 2.4.8
104
+ rubygems_version: 2.5.1
105
105
  signing_key:
106
106
  specification_version: 4
107
107
  summary: Redis(zset/set/list/string/publish) output plugin for Fluentd