fluent-plugin-formatter_pretty_json 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 89dab036db1013b2dd7cb2e40e34c630f57b4f3c
4
+ data.tar.gz: 02445b9091de4a966462271d06af04216c5feae5
5
+ SHA512:
6
+ metadata.gz: 8861987dd270329682418e4fd9ce77286ae1acafed7b53fef5110a6929c2680eb9baf652d7552e434fd7c01bd5c9467789d5392e62ae7bd518cc10a27f3515f3
7
+ data.tar.gz: 9ea0b4dcf01e9cc92cd56080356635601046c439fcc1dd3ed65d7524247712176df83756b802d0b36be5b97d676af3f5a56d87206d49eb194758711aed6f2919
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /test/reports/
9
+ /tmp/
@@ -0,0 +1 @@
1
+ 2.2.3
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0
4
+ - 2.1
5
+ - 2.2
6
+ before_install: gem install bundler -v 1.10.6
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Yoshihiro MIYAI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
@@ -0,0 +1,59 @@
1
+ ## fluent-plugin-formatter_pretty_json
2
+
3
+ [![Build Status](https://travis-ci.org/mia-0032/fluent-plugin-formatter_pretty_json.svg)](https://travis-ci.org/mia-0032/fluent-plugin-formatter_pretty_json)
4
+
5
+ [Fluentd](http://www.fluentd.org/) formatter plugin for formatting record to pretty json.
6
+
7
+ ### Installation
8
+
9
+ Install by gem:
10
+
11
+ ```shell
12
+ $ gem install fluent-plugin-formatter_pretty_json
13
+ ```
14
+
15
+ Or if you use td-agent:
16
+
17
+ ```shell
18
+ $ flunet-gem install fluent-plugin-formatter_pretty_json
19
+ ```
20
+
21
+ ### Usage
22
+
23
+ You simply specify `pretty_json` at `format` config param in formatter available plugins.
24
+
25
+ Like below:
26
+
27
+ ```
28
+ <match test.**>
29
+ type file
30
+ path /path/to/file
31
+ format pretty_json
32
+ </match>
33
+ ```
34
+
35
+ Output is like below:
36
+
37
+ ```
38
+ {
39
+ "foo": "bar",
40
+ "test": "hoge"
41
+ }
42
+ {
43
+ "foo": "bar",
44
+ "test": "hoge"
45
+ }
46
+ ```
47
+
48
+ Also you can use `include_time_key`, `time_key`, `time_format`,
49
+ `include_tag_key`, `tag_key`, `localtime`, `timezone` parameters.
50
+
51
+ If you use these parameters, you see http://docs.fluentd.org/articles/out_file#format .
52
+
53
+ ### Contributing
54
+
55
+ 1. Fork it
56
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
57
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
58
+ 4. Push to the branch (`git push origin my-new-feature`)
59
+ 5. Create a new Pull Request
@@ -0,0 +1,7 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ require 'rake/testtask'
4
+
5
+ Rake::TestTask.new(:test)
6
+
7
+ task :default => :test
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "fluent-plugin-formatter_pretty_json"
5
+ spec.version = "0.0.1"
6
+ spec.authors = ["Yoshihiro MIYAI"]
7
+ spec.email = ["msparrow17@gmail.com"]
8
+
9
+ spec.summary = %q{Fluentd formatter plugin pretty json.}
10
+ spec.description = %q{Fluentd formatter plugin for formatting record to pretty json.}
11
+ spec.homepage = "https://github.com/mia-0032/fluent-plugin-formatter_pretty_json"
12
+
13
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
14
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
15
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
16
+ spec.require_paths = ["lib"]
17
+
18
+ spec.add_development_dependency "bundler"
19
+ spec.add_development_dependency "rake"
20
+ spec.add_development_dependency "test-unit"
21
+
22
+ spec.add_runtime_dependency "fluentd", ">= 0.12.0"
23
+ end
@@ -0,0 +1,20 @@
1
+ # coding: utf-8
2
+
3
+ module Fluent
4
+ module TextFormatter
5
+ class PrettyJsonFormatter < Formatter
6
+ Plugin.register_formatter('pretty_json', self)
7
+
8
+ include Configurable
9
+ include HandleTagAndTimeMixin
10
+
11
+ def configure(conf)
12
+ super
13
+ end
14
+
15
+ def format(tag, time, record)
16
+ "#{JSON.pretty_generate record}\n"
17
+ end
18
+ end
19
+ end
20
+ end
metadata ADDED
@@ -0,0 +1,108 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fluent-plugin-formatter_pretty_json
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Yoshihiro MIYAI
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-09-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: test-unit
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: fluentd
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: 0.12.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: 0.12.0
69
+ description: Fluentd formatter plugin for formatting record to pretty json.
70
+ email:
71
+ - msparrow17@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - ".ruby-version"
78
+ - ".travis.yml"
79
+ - Gemfile
80
+ - LICENSE
81
+ - README.md
82
+ - Rakefile
83
+ - fluent-plugin-formatter_pretty_json.gemspec
84
+ - lib/fluent/plugin/formatter_pretty_json.rb
85
+ homepage: https://github.com/mia-0032/fluent-plugin-formatter_pretty_json
86
+ licenses: []
87
+ metadata: {}
88
+ post_install_message:
89
+ rdoc_options: []
90
+ require_paths:
91
+ - lib
92
+ required_ruby_version: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ required_rubygems_version: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ requirements: []
103
+ rubyforge_project:
104
+ rubygems_version: 2.4.5.1
105
+ signing_key:
106
+ specification_version: 4
107
+ summary: Fluentd formatter plugin pretty json.
108
+ test_files: []