fluent-plugin-json-in-json 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/fluent-plugin-json-in-json.gemspec +1 -1
- data/lib/fluent/plugin/parser_json_in_json.rb +13 -5
- 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: 516f10d88898ff297402ec12ce5fcd3194e19851
|
4
|
+
data.tar.gz: 04a51da2be344471238e10065d6fbb5bf261ba97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84010a6713575b8a24ad19ed8499e36d77334bd4eecf435121b25e75575926e5fac08f793671d99c152d93d4372d01e360f705ddaa69949490efbe959988656e
|
7
|
+
data.tar.gz: 6793e3a089f3ec0c936d8290eac34ec82d22400aa6918202d899490db72c155c589f87fe21fa0914bf5e35f08f713be4a975084fdff4b8ff322c9a98be3f8138
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
Gem::Specification.new do |spec|
|
3
3
|
spec.name = "fluent-plugin-json-in-json"
|
4
|
-
spec.version = "0.1.
|
4
|
+
spec.version = "0.1.2"
|
5
5
|
spec.authors = ["Gavin M. Roy"]
|
6
6
|
spec.email = ["gavinmroy@gmail.com"]
|
7
7
|
spec.description = %q{Parser plugin that parses JSON attributes with JSON strings in them}
|
@@ -2,15 +2,23 @@ require 'yajl'
|
|
2
2
|
|
3
3
|
module Fluent
|
4
4
|
class TextParser
|
5
|
-
class JSONInJSONParser <
|
5
|
+
class JSONInJSONParser < Parser
|
6
6
|
Fluent::Plugin.register_parser('json_in_json', self)
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
config_param :time_key, :string, :default => 'time'
|
9
|
+
config_param :time_format, :string, :default => nil
|
10
10
|
|
11
|
-
|
12
|
-
|
11
|
+
def configure(conf)
|
12
|
+
super
|
13
|
+
|
14
|
+
unless @time_format.nil?
|
15
|
+
@time_parser = TimeParser.new(@time_format)
|
16
|
+
@mutex = Mutex.new
|
13
17
|
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def parse(text)
|
21
|
+
record = Yajl.load(text)
|
14
22
|
|
15
23
|
value = @keep_time_key ? record[@time_key] : record.delete(@time_key)
|
16
24
|
if value
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-json-in-json
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gavin M. Roy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yajl-ruby
|