fluent-plugin-json-nest2flat 0.0.1 → 0.0.2
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/README.md +19 -21
- data/fluent-plugin-json-nest2flat.gemspec +2 -2
- data/lib/fluent/plugin/out_json_nest2flat.rb +4 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39aa031bc4ca3dbbcfe8dc1fbe323561e6cead35
|
4
|
+
data.tar.gz: 2c0999c66deae40b1b019a587677a2aa556e79d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0321d7477d85008676f44a9e34755a1bfe3a225099757cbd840e2b10616280241e16805c07597e4700401b524d4b6e12f3e78c0582af7b69d630692ee07e905d
|
7
|
+
data.tar.gz: 20fb960d5b8b13fac4257d05628b2aba5446329a4ae2cef29e5076a950e60637012f86968ede9205f4d3d5e231a68cbf88d1f051e58d027876c5ac613e30c589
|
data/README.md
CHANGED
@@ -1,29 +1,27 @@
|
|
1
|
-
#
|
1
|
+
# fluent-plugin-json-nest2flat
|
2
|
+
# Overview
|
2
3
|
|
3
|
-
|
4
|
+
json_nest2flat is a fluentd output plugin.
|
5
|
+
I will convert data into a flat data structure of JSON nested.
|
4
6
|
|
5
|
-
|
7
|
+
ex. {“hoge”:1, “foo”:2, “data”:{"name":"taro", "age":18, "height":175}} -> ex. {“hoge”:1, “foo”:2, "name":"taro", "age":18, "height":175}
|
6
8
|
|
7
|
-
Add this line to your application's Gemfile:
|
8
9
|
|
9
|
-
|
10
|
+
# Configuration
|
10
11
|
|
11
|
-
|
12
|
+
<match pattern>
|
13
|
+
type json_nest2flat
|
14
|
+
json_keys data1,data2,data3
|
15
|
+
</match>
|
12
16
|
|
13
|
-
|
17
|
+
# Parameters
|
18
|
+
* json_keys
|
14
19
|
|
15
|
-
|
20
|
+
It is the key that you want to convert to a flat structure from JSON nested. It is more than one can be specified in a comma-separated.
|
21
|
+
|
22
|
+
# TODO
|
16
23
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
TODO: Write usage instructions here
|
22
|
-
|
23
|
-
## Contributing
|
24
|
-
|
25
|
-
1. Fork it
|
26
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
-
5. Create new Pull Request
|
24
|
+
Currently, nested structure of two or more layers will be unexpected.
|
25
|
+
|
26
|
+
# Copyright
|
27
|
+
Copyright:: Copyright (c) 2013- fukuiretu License:: Apache License, Version 2.0
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
Gem::Specification.new do |spec|
|
3
3
|
spec.name = "fluent-plugin-json-nest2flat"
|
4
|
-
spec.version = "0.0.
|
5
|
-
spec.authors = ["
|
4
|
+
spec.version = "0.0.2"
|
5
|
+
spec.authors = ["Fukui ReTu"]
|
6
6
|
spec.email = ["s0232101@gmail.com"]
|
7
7
|
spec.description = %q{Output filter plugin to convert to a flat structure the JSON that is nest}
|
8
8
|
spec.summary = %q{Output filter plugin to convert to a flat structure the JSON that is nest}
|
@@ -3,6 +3,7 @@ module Fluent
|
|
3
3
|
|
4
4
|
Fluent::Plugin.register_output('json_nest2flat', self)
|
5
5
|
|
6
|
+
config_param :tag, :string, :default => 'json_nest2flat'
|
6
7
|
config_param :json_keys, :string, :default => nil
|
7
8
|
|
8
9
|
def configure(conf)
|
@@ -13,6 +14,7 @@ module Fluent
|
|
13
14
|
raise Fluent::ConfigError, "json_keys is undefined!"
|
14
15
|
end
|
15
16
|
|
17
|
+
@tag = conf['tag']
|
16
18
|
@json_keys = @json_keys.split(",")
|
17
19
|
end
|
18
20
|
|
@@ -22,7 +24,7 @@ module Fluent
|
|
22
24
|
|
23
25
|
new_record = _convert_record(record);
|
24
26
|
|
25
|
-
Fluent::Engine.emit(tag, time, new_record)
|
27
|
+
Fluent::Engine.emit(@tag, time, new_record)
|
26
28
|
}
|
27
29
|
end
|
28
30
|
|
@@ -48,7 +50,7 @@ module Fluent
|
|
48
50
|
end
|
49
51
|
}
|
50
52
|
|
51
|
-
unless json_keys_exist_count
|
53
|
+
unless json_keys_exist_count == 0
|
52
54
|
$log.warn "json_keys is not found."
|
53
55
|
end
|
54
56
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-json-nest2flat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Fukui ReTu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|