fluent-plugin-mysql-query
===========================
Fluentd Input plugin to execute mysql query for stationary measurement.
## Installation
### native gem
`````
gem install fluent-plugin-mysql-query
`````
### td-agent gem
`````
/usr/lib64/fluent/ruby/bin/fluent-gem install fluent-plugin-mysql-query
`````
## Configuration
### Config Sample
`````
type stdout
`````
### Output Sample
record_hostname: yes, nest_result: no
`````
input.mysql: {"hostname":"myhost.example.com","Variable_name":"thread_cache_size","Value":"16"}
input.mysql: {"hostname":"myhost.example.com","Variable_name":"thread_stack","Value":"262144"}
`````
record_hostname: yes, nest_result: yes, nest_key: data
`````
input.mysql: {"hostname":"myhost.example.com","data":[{"Variable_name":"thread_cache_size","Value":"16"},{"Variable_name":"thread_stack","Value":"262144"}]}
`````
record_hostname: yes, nest_result: yes, nest_key: data, row_count: yes, row_count_key: row_count
`````
input.mysql: {"hostname":"myhost.example.com","row_count":2,"data":[{"Variable_name":"thread_cache_size","Value":"16"},{"Variable_name":"thread_stack","Value":"262144"}]}
`````
### Example Query
* SHOW VARIABLES LIKE 'Thread_%';
* SELECT MAX(id) AS max_foo_id FROM foo_table;
* SHOW FULL PROCESSLIST;
* INSERT INTO log (data, created_at) VALUES((SELECT MAX(id) FROM foo_table), NOW());
* SHOW SLAVE STATUS;
* SHOW INNODB STATUS;
## TODO
patches welcome!
* support result_key_downcase option
## Copyright
Copyright © 2012- Kentaro Yoshida (@yoshi_ken)
## License
Apache License, Version 2.0