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

Development

~> 1.7.2
~> 10.3.2
~> 2.4
~> 0.8

Runtime

 Project Readme

fluent-client

fluentd command line utility

Examples

simple post to fluentd

$ fluent-client --post sometag --data id:1 name:toyama
#=> 2014-09-14 17:43:40 +0900 sometag: {"id":"1","name":"toyama"}

simple post to fluentd other host

$ fluent-client --post sometag --data id:1 name:toyama -h aggregate-host -p 24223

post stdin json

$ echo '[{"hoge":"fuga"},{"hoge":"fuga2"}]' | fluent-client -j sometag
#=> 2014-09-14 22:30:26 +0900 sometag: {"hoge":"fuga"}
#=> 2014-09-14 22:30:26 +0900 sometag: {"hoge":"fuga2"}

post stdin file with regular expression

$ cat server.csv
i-xxxxxxx web01 running
i-xxxxxxx web02 running
i-xxxxxxx web03 running
i-xxxxxxx web04 running
i-xxxxxxx batch01 running

$ cat server.txt | fluent-client post_parse_text sometag --format "/^(?<instance_id>[^ ]*) (?<name>[^ ]*) (?<state>[^ ]*)$/"
#=> {"instance_id"=>"i-xxxxxxx", "name"=>"web01", "state"=>"running"}
#=> {"instance_id"=>"i-xxxxxxx", "name"=>"web02", "state"=>"running"}
#=> {"instance_id"=>"i-xxxxxxx", "name"=>"web03", "state"=>"running"}
#=> {"instance_id"=>"i-xxxxxxx", "name"=>"web04", "state"=>"running"}
#=> {"instance_id"=>"i-xxxxxxx", "name"=>"batch01", "state"=>"running"}

※ multiline not support

post stdin csv file

$ cat server.csv
i-xxxxxxx,web01,running
i-xxxxxxx,web02,running
i-xxxxxxx,web03,running
i-xxxxxxx,web04,running
i-xxxxxxx,batch01,running

$ cat server.csv | fluent-client post_parse_text sometag --format csv --keys instance_id,name,state
#=> {"instance_id"=>"i-xxxxxxx", "name"=>"web01", "state"=>"running"}
#=> {"instance_id"=>"i-xxxxxxx", "name"=>"web02", "state"=>"running"}
#=> {"instance_id"=>"i-xxxxxxx", "name"=>"web03", "state"=>"running"}
#=> {"instance_id"=>"i-xxxxxxx", "name"=>"web04", "state"=>"running"}
#=> {"instance_id"=>"i-xxxxxxx", "name"=>"batch01", "state"=>"running"}

default values

default host: localhost

default port: 24224

Installation

Add this line to your application's Gemfile:

gem 'fluent-client'

And then execute:

$ bundle

Or install it yourself as:

$ gem install fluent-client

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

Information

Copyright

Copyright (c) 2014 Hiroshi Toyama

See LICENSE.txt for details.