fluent-plugin-text_to_json 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fluent/plugin/formatter_text_to_json.rb +6 -9
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c644c81bf90e033900c295af18ed1dedeb61c20
|
4
|
+
data.tar.gz: 1dd7c1776b5b67fede01b5c631de39a6135bda8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7cc15fa02ba62e03ee3bbbebb0dccad8a1b7c5a16a4f0152e4af2b28a783d5d169289fb11e35ecab3e0dd7518ed689f1e3fc2f8d890e9464f8b69539ae8c68cd
|
7
|
+
data.tar.gz: 45511c165b3f23126829a9b2cc8dfc3f0d5b6bafa1ab93849650b937ae615bb00580ae8a2e2f2ade04874a6b204d4f37dbb2e996738df863d344a0631e28f4aa
|
@@ -1,13 +1,9 @@
|
|
1
|
-
require "fluent/formatter"
|
2
|
-
|
3
1
|
module Fluent
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
include Configurable
|
2
|
+
module TextFormatter
|
3
|
+
class TextToJsonFormatter < Formatter
|
4
|
+
Fluent::Plugin.register_formatter('text_to_json', self)
|
9
5
|
|
10
|
-
config_param :json_field, :string
|
6
|
+
config_param :json_field, :string, :default => "sdr,factor,1,2,3,4,5,6,7,8,9,10,11,12,13"
|
11
7
|
config_param :field_splitter, :string
|
12
8
|
|
13
9
|
def configure(conf)
|
@@ -15,7 +11,7 @@ module Fluent
|
|
15
11
|
@fields = @json_field.split(",").map{|field| "\"" + field + "\""}
|
16
12
|
end
|
17
13
|
|
18
|
-
def format(record)
|
14
|
+
def format(tag, time, record)
|
19
15
|
tmp_field = Array.new
|
20
16
|
tmp_field = record.split(@field_splitter)
|
21
17
|
|
@@ -55,4 +51,5 @@ module Fluent
|
|
55
51
|
|
56
52
|
end
|
57
53
|
end
|
54
|
+
end
|
58
55
|
end
|