0.0
No commit activity in last 3 years
No release in over 3 years
A utility to format or check fluentd configuration
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
>= 0

Runtime

>= 0
 Project Readme

fluent-format Build Status

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.conf

Input Example:

<source>
     type forward
</source>

   <match test>
    type stdout
</match>

Output Example:

<source>
  type forward
</source>
<match test>
  type stdout
</match>

See help for more options

$ fluent-format help format

Check

$ fluent-format check -c fluent.conf -p plugin_dir
$ echo $? # 0 or 1

This 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

require 'fluent-format'

File.open(path) {|config|
  puts Fluent::Format.format(config)
}

or

require 'fluent-format'

puts Fluent::Format.format(path)

Use the 2nd way when you want to exapnd include directive.

Check

require 'fluent-format'

File.open(path) {|config|
  Fluent::Format.check(config, plugin_dir)
  #=> Fluent::ConfigParseError or Fluent::ConfigError if failed
}

or

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