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 +4 -4
- data/README.md +22 -17
- data/fluent-plugin-redis-store-wejick.gemspec +1 -1
- data/lib/fluent/plugin/out_redis_store_wejick.rb +28 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c15a86a6dd606a7ed86a89c87ba70a3b6f15bcd
|
4
|
+
data.tar.gz: e28380c9597f85e075822e7a36d2f252c073c5ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
125
|
-
|
|
126
|
-
| `order`
|
127
|
-
| `prevent_duplicate` | (0,1)
|
128
|
-
| `string_tolow`
|
129
|
-
| `string_unescape` | (0,1) | 0 | unescape value
|
130
|
-
| `string_unescape_twice`
|
131
|
-
| `
|
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
|
140
|
-
| :----
|
141
|
-
| `score_path`
|
142
|
-
| `value_expire`
|
143
|
-
| `prevent_duplicate` | (0,1)
|
144
|
-
| `string_tolow`
|
145
|
-
| `string_unescape` | (0,1)
|
146
|
-
| `string_unescape_twice`
|
147
|
-
| `
|
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.
|
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.
|
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-
|
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.
|
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
|