fluent-plugin-cloudsearch 0.1.0 → 0.1.1
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/fluent-plugin-cloudsearch.gemspec +1 -1
- data/lib/fluent/plugin/out_cloudsearch.rb +17 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71d2ea4bd1537c261a1f2f3ad02f22995d036553
|
4
|
+
data.tar.gz: e68875cb30e7bed63608ce07f08b72d8369e2d84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bc76df6973ec1ca416e58c1ce29290491ccbaed4ea92687adfe9a4f09d5177174c25415853502d87c60f2c7903611ed72e66cacc68429251f5fefbee70c48d6
|
7
|
+
data.tar.gz: f88975b8084c1bbdae8965050b989a9162b14ef20059702aacaf3fb7ddf71e6cd20af097405e17a88390edab9a856cf40e8ab23eaaadaf19802985ad3b566837
|
@@ -15,6 +15,9 @@ module Fluent
|
|
15
15
|
# message packをJSONにした時に5MBを超えないように
|
16
16
|
MAX_SIZE_LIMIT = 4.5 * 1024 * 1024
|
17
17
|
|
18
|
+
# https://docs.aws.amazon.com/en_us/cloudsearch/latest/developerguide/preparing-data.html
|
19
|
+
INVALID_CHAR_REGEX = /[^\u0009\u000a\u000d\u0020-\uD7FF\uE000-\uFFFD]/
|
20
|
+
|
18
21
|
def initialize
|
19
22
|
super
|
20
23
|
|
@@ -67,7 +70,20 @@ module Fluent
|
|
67
70
|
return ''
|
68
71
|
end
|
69
72
|
|
70
|
-
|
73
|
+
r = record.dup
|
74
|
+
f = r['fields']
|
75
|
+
if f.kind_of? Hash
|
76
|
+
# replace invalid char to white space
|
77
|
+
f.each do |key, value|
|
78
|
+
if value.kind_of? String
|
79
|
+
f[key] = value.gsub(INVALID_CHAR_REGEX, ' ')
|
80
|
+
else
|
81
|
+
f[key] = value
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
return "#{r.to_json},"
|
71
87
|
end
|
72
88
|
|
73
89
|
def write(chunk)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-cloudsearch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kensaku Araga
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|