fluent-plugin-kestrel
fluentd input/output plugin for kestrel.
fluentd is an event collector system. see github.com/fluent/fluentd
kestrel is a simple, distributed message queue. see github.com/robey/kestrel
Installation
gem install fluent-plugin-kestrel
Fluentd Configuration
Output
<match kestrel.**>
type kestrel
host localhost # (required) kestrel host
queue fluent # (required) queue name of kestrel
port 22133 # (optional) kestrel port. default 22133
ttl 100 # (optional) ttl(sec). default=0 (never expire)
# output format options
output_include_time false # (optional) default true
output_include_tag false # (optional) default true
remove_prefix kestrel # (optional) remove tag prefix.
# ex) "kestrel.access" -> "access"
field_separator COMMA # (optional) default '\t'.
# you can use SPACE and COMMA
time_format %Y-%m-%d %H-%M-%S # (optional)
</match>
Input
<source>
type kestrel
host localhost # (required) kestrel host
queue fluent # (required) kestrel queue name
tag kestrel.log # (required) fluentd tag
port 22133 # (optional) kestrel port. default 22133
timeout 10 # (optional) default 10.
</source>
Output Data Format
default
[time]\t[tag]\t[resource(JSON)]
2012-02-11T16:38:54Z apache.access {"host":"::1","user":"-","method":"GET","path":"/test/}
format options
field_separator COMMA
[time],[tag],[resource(JSON)]
2012-02-11T16:38:54Z,apache.access,{"host":"::1","user":"-","method":"GET","path":"/test/}
field_separator SPACE
[time] [tag] [resource(JSON)]
2012-02-11T16:38:54Z apache.access {"host":"::1","user":"-","method":"GET","path":"/test/}
output_include_tag false
[time]\t[resource(JSON)]
2012-02-11T16:38:54Z {"host":"::1","user":"-","method":"GET","path":"/test/}
output_include_time false
[tag]\t[resource(JSON)]
apache.access {"host":"::1","user":"-","method":"GET","path":"/test/}
remove_prefix apache
[time]\t[tag(prefix removed)]\t[resource(JSON)]
2012-02-11T16:38:54Z access {"host":"::1","user":"-","method":"GET","path":"/test/}
time_format %Y/%m/%d %H-%M-%S
[time(original format)]\t[tag]\t[resource(JSON)]
2012/02/11 16-38-54 apache.access {"host":"::1","user":"-","method":"GET","path":"/test/}
check output data
you can see its data format like so:
$ telnet localhost 22133
get test
VALUE test 0 125
2012-02-11T16:38:54Z apache.access {"host":"::1","user":"-","method":"GET","path":"/test/","code":"304","size":"-"}
END
Contributing to fluent-plugin-kestrel
-
Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet.
-
Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it.
-
Fork the project.
-
Start a feature/bugfix branch.
-
Commit and push until you are happy with your contribution.
-
Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.
-
Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
Copyright
- Copyright
-
Copyright © 2012 Junichiro Takagi
- License
-
Apache License, Version 2.0