fluent-plugin-text_to_json 0.1.12 → 0.1.13

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: 36b5bdc51760b01d47ca2f59becea2f0b1f1333e
4
- data.tar.gz: 14493aaace8f29744624cf33a1d2e9237ff230cb
3
+ metadata.gz: 663d4b9508a5ebdf5ec6100afcb296dc46c4f1bf
4
+ data.tar.gz: 001a1031692ff98369de8633a1be426b2be5baa5
5
5
  SHA512:
6
- metadata.gz: 07a54df15216fd269db0ce112f10aa3c709f8fc57baaa21e0ed1ac0f31153631838d81efacabf16467744efd2282c857e9636e674b6140330925765d4c58c35b
7
- data.tar.gz: 7600d0a08c306f8e42dac06e7bca102ff7727e92d5cc209f59bbef04ffc478a2dbf06dddbbc5a15ccc2a3edb0e1cc73dff0e6ad787bb99ed65cc3e21c5dc5294
6
+ metadata.gz: 447628ff06af9ac1526491620fe6e49df3bbe77f56654da5f351cba1721e89c1664c8fb046c9ce1f80f0b2eb286b3424964b555ef4162222b9e12d91513db43a
7
+ data.tar.gz: 65af452f7f7d34ef2b3feeff48d9f477e8c9d2446dd097f93db669d47158a29eca21a96a94389683550daadd4a0adcd1a85574ddb64b8cf79b16604785a36ba1
@@ -15,41 +15,42 @@ module Fluent
15
15
  end
16
16
 
17
17
  def format(tag, time, record)
18
- tmp_field = Array.new
19
- tmp_field = record.split(@field_splitter)
20
-
21
- tmp_field[1] = @field_splitter + tmp_field[1]
22
-
23
-
24
- #sdr parameters to json format
25
- tmp_field[0] = tmp_field[0].split("\n")
26
- tmp_field[0] = tmp_field[0].map{|value| (value == "")? nil:value} # HBase plugin ignores nil values
27
- tmp_field[0] = tmp_field[0].map{|value| (value == nil)? nil:"\""+value+"\""}
28
-
29
- tmp_field[0] = @fields[2,14].zip(tmp_field[0])
30
- tmp_field[0] = tmp_field[0].map{|x| x.join(":")}.join(",")
31
- tmp_field[0] = @field[0] + ":" + "{" + tmp_field[0] + "}"
32
-
33
-
34
- #factor paramters to json format
35
- tmp_field[1] = tmp_field[1].split("\n")
36
- #Set factor ID as a second field's name
37
- head, *tail = tmp_field[1].split("\n")
38
- haed = head.split("|")
39
- head = head.map{|field| "\""+field+"\""}
40
-
41
-
42
- tail = tail.map{|values| values.split("|")}
43
-
44
- new_tail = Array.new(head.length)
45
-
46
- for i in 0..head.length-1
47
- new_tail[i] = "\"" + tail.map{|values| values[i]}.join(",") + "\""
48
- end
18
+
19
+ record.tojason
20
+ #tmp_field = record.split(@field_splitter)
21
+ #
22
+ #tmp_field[1] = @field_splitter + tmp_field[1]
23
+ #
24
+
25
+ ##sdr parameters to json format
26
+ #tmp_field[0] = tmp_field[0].split("\n")
27
+ #tmp_field[0] = tmp_field[0].map{|value| (value == "")? nil:value} # HBase plugin ignores nil values
28
+ #tmp_field[0] = tmp_field[0].map{|value| (value == nil)? nil:"\""+value+"\""}
29
+ #
30
+ #tmp_field[0] = @fields[2,14].zip(tmp_field[0])
31
+ #tmp_field[0] = tmp_field[0].map{|x| x.join(":")}.join(",")
32
+ #tmp_field[0] = @field[0] + ":" + "{" + tmp_field[0] + "}"
33
+ #
34
+
35
+ ##factor paramters to json format
36
+ #tmp_field[1] = tmp_field[1].split("\n")
37
+ ##Set factor ID as a second field's name
38
+ #head, *tail = tmp_field[1].split("\n")
39
+ #haed = head.split("|")
40
+ #head = head.map{|field| "\""+field+"\""}
41
+
42
+
43
+ #tail = tail.map{|values| values.split("|")}
44
+
45
+ #new_tail = Array.new(head.length)
46
+ #
47
+ #for i in 0..head.length-1
48
+ #new_tail[i] = "\"" + tail.map{|values| values[i]}.join(",") + "\""
49
+ #end
49
50
 
50
- tmp_field[1] = "{" + head.zip(new_tail).map{|field,value| field + ":" + value }.join(",") + "}"
51
-
52
- "{" + @fileds[0] + ":" + "{" + tmp_field[0] + "}," + @fields[1] + ":" + "{" + tmp_field[1] + "}}"
51
+ #tmp_field[1] = "{" + head.zip(new_tail).map{|field,value| field + ":" + value }.join(",") + "}"
52
+ #
53
+ #"{" + @fileds[0] + ":" + "{" + tmp_field[0] + "}," + @fields[1] + ":" + "{" + tmp_field[1] + "}}"
53
54
 
54
55
 
55
56
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-text_to_json
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - minwoo lee
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-30 00:00:00.000000000 Z
11
+ date: 2017-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler