Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sonots/fluent-format
A utility to format or check fluentd configuration
https://github.com/sonots/fluent-format
Last synced: 3 months ago
JSON representation
A utility to format or check fluentd configuration
- Host: GitHub
- URL: https://github.com/sonots/fluent-format
- Owner: sonots
- License: mit
- Created: 2013-12-04T11:25:08.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-12-01T18:47:33.000Z (about 10 years ago)
- Last Synced: 2024-04-24T12:05:05.242Z (8 months ago)
- Language: Ruby
- Homepage:
- Size: 328 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# fluent-format [![Build Status](https://travis-ci.org/sonots/fluent-format.png?branch=master)](https://travis-ci.org/sonots/fluent-format)
An utility to format or check fluentd configuration
## Installation
Add this line to your application's Gemfile:
gem 'fluent-format'
And then execute:
$ bundle
Or install it yourself as:
$ gem install fluent-format
## Command Line Interface
### Format
$ fluent-format format -c fluent.conf
or
$ fluent-format -c fluent.confInput Example:
```
type forward
type stdout```
Output Example:
```
type forward
type stdout
```
See help for more options
$ fluent-format help format
### Check
$ fluent-format check -c fluent.conf -p plugin_dir
$ echo $? # 0 or 1This returns the status code 0 if check passed,
and status code 1 with error messages if check failed.See help for more options
$ fluent-format help check
## As a library
### Format
```ruby
require 'fluent-format'File.open(path) {|config|
puts Fluent::Format.format(config)
}
```or
```ruby
require 'fluent-format'puts Fluent::Format.format(path)
```Use the 2nd way when you want to exapnd `include` directive.
### Check
```ruby
require 'fluent-format'File.open(path) {|config|
Fluent::Format.check(config, plugin_dir)
#=> Fluent::ConfigParseError or Fluent::ConfigError if failed
}
```or
```ruby
require 'fluent-format'Fluent::Format.check(path, plugin_dir)
#=> Fluent::ConfigParseError or Fluent::ConfigError if failed
```Use the 2nd way when you want to exapnd `include` directive.
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request## Licenses
See [LICENSE](LICENSE)