fluent-plugin-json-nest2flat 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 116db9905231f401d65f59f92619ee8e189c85cf
4
- data.tar.gz: ef946f489f65f30e155c495acf791d537c9ccb3b
3
+ metadata.gz: 39aa031bc4ca3dbbcfe8dc1fbe323561e6cead35
4
+ data.tar.gz: 2c0999c66deae40b1b019a587677a2aa556e79d3
5
5
  SHA512:
6
- metadata.gz: b526ee7234f34eab9b92cdcc7a46b2ee66af6b579fe82d727dcb4fe54beb95613b6c55557df7be8fa55018cc9a5f543cc036330c83922e740bd85b16555cbc28
7
- data.tar.gz: 5f02de95f8379300bffb267ab1ceaea7444693132df2a7287394589ad121fc5d2a9f92849f86445871a393caf45402cbb18368e7c3b1a88306d7732f71841d3b
6
+ metadata.gz: 0321d7477d85008676f44a9e34755a1bfe3a225099757cbd840e2b10616280241e16805c07597e4700401b524d4b6e12f3e78c0582af7b69d630692ee07e905d
7
+ data.tar.gz: 20fb960d5b8b13fac4257d05628b2aba5446329a4ae2cef29e5076a950e60637012f86968ede9205f4d3d5e231a68cbf88d1f051e58d027876c5ac613e30c589
data/README.md CHANGED
@@ -1,29 +1,27 @@
1
- # Fluent::Plugin::Json::Nest2flat
1
+ # fluent-plugin-json-nest2flat
2
+ # Overview
2
3
 
3
- TODO: Write a gem description
4
+ json_nest2flat is a fluentd output plugin.
5
+ I will convert data into a flat data structure of JSON nested.
4
6
 
5
- ## Installation
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
- gem 'fluent-plugin-json-nest2flat'
10
+ # Configuration
10
11
 
11
- And then execute:
12
+ <match pattern>
13
+ type json_nest2flat
14
+ json_keys data1,data2,data3
15
+ </match>
12
16
 
13
- $ bundle
17
+ # Parameters
18
+ * json_keys
14
19
 
15
- Or install it yourself as:
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
- $ gem install fluent-plugin-json-nest2flat
18
-
19
- ## Usage
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.1"
5
- spec.authors = ["FukuiRetu"]
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 > 0
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.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
- - FukuiRetu
7
+ - Fukui ReTu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-24 00:00:00.000000000 Z
11
+ date: 2013-12-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler