fluent-plugin-text_to_json 0.1.54 → 0.1.55

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: 217acdb1fd92ab52fbe5d7aae399da1acf835a6d
4
- data.tar.gz: 163ab8796886c3442c8b60307dad12e47f243d3c
3
+ metadata.gz: 6c9de52a453ded90154c36d6265109c03c9403b8
4
+ data.tar.gz: 93746664bd09d8746cc4c3b7ac1274b21668a7e8
5
5
  SHA512:
6
- metadata.gz: 0816697248ec2faf1af003ef1c67ad3eda6af1c8341d91d9f2a205553d29c755c3f44503b7cc0cf557ee11adc79a18a28b32633d98ab56841526d2c96a2b98e7
7
- data.tar.gz: 7dcc9a6b32c9659247d0975a8bab1f0073927f4859c146940d7c2ac2918f923a440aa13c6655a8a0728d179b50b6c9b750432eec650cfc289c60863ecd5dbdb3
6
+ metadata.gz: 24ed35f08237283216bd6648a3646bca9b8210afeec584c30ac444ddcc5f33e453d052b0f86d8aa25b45bce1d0451009c15b81c7e3da6b2414b254f5c9bacda4
7
+ data.tar.gz: 87b3feb17bff033ad70f0b44a98a53e3bc1b704c7adfcd7ab7fef8f1bb7e478b0451f2437cdc7f77737d461c492b1aec5f707f4530c8156e666f16c775f7e38b
@@ -5,13 +5,14 @@ module Fluent
5
5
  module TextFormatter
6
6
  class TextToJsonFormatter < Formatter
7
7
  Fluent::Plugin.register_formatter('text_to_json', self)
8
-
8
+ helpers :formatter
9
9
  config_param :json_field, :string, :default => "sdr,factor,1,2,3,4,5,6,7,8,9,10,11,12,13"
10
10
  config_param :field_splitter, :string, :default => "A000"
11
11
 
12
12
  def configure(conf)
13
13
  super
14
14
  @fields = @json_field.split(",").map{|field| "\"" + field + "\""}
15
+ @formatter = formatter_create(type: 'json')
15
16
  end
16
17
 
17
18
  def format(tag, time, record)
@@ -50,7 +51,7 @@ module Fluent
50
51
  tmp_field[1] = head.zip(new_tail).map{|field,value| field + ":" + value }.join(",")
51
52
 
52
53
  out_string = "{#{@fields[0]}:{#{tmp_field[0]}},#{@fields[1]}:{#{tmp_field[1]}}}"
53
- out_string.to_json
54
+ @formatter.format(tag, time, out_string)
54
55
 
55
56
 
56
57
  end
metadata CHANGED
@@ -1,7 +1,7 @@
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.54
4
+ version: 0.1.55
5
5
  platform: ruby
6
6
  authors:
7
7
  - minwoo lee