Last active
August 29, 2015 14:08
-
-
Save okisanjp/32c53847d3a2887215d0 to your computer and use it in GitHub Desktop.
fluent-plugin-mackerelでhttpdのステータスコードを送信 ref: http://qiita.com/okisanjp/items/9da6220e2230b06eb76a
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # /usr/lib64/fluent/ruby/bin/fluent-gem install fluent-plugin-datacounter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # /usr/lib64/fluent/ruby/bin/fluent-gem install fluent-plugin-mackerel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <source> | |
| type tail | |
| format apache2 | |
| path /var/log/httpd/access.log | |
| pos_file /var/log/td-agent/access.log.pos | |
| tag data.httpd.accesslog | |
| </source> | |
| <match data.httpd.accesslog> | |
| type datacounter | |
| count_interval 1m | |
| count_key code | |
| tag mackerel.httpd.accesslog | |
| outcast_unmatched yes | |
| pattern1 2xx ^2\d\d$ | |
| pattern2 3xx ^3\d\d$ | |
| pattern3 404 ^404$ | |
| pattern4 4xx ^4\d\d$ | |
| pattern5 5xx ^5\d\d$ | |
| </match> | |
| <match mackerel.httpd.accesslog> | |
| type mackerel | |
| api_key YOUR_API_KEY | |
| service YOUR_SERVICE_NAME | |
| metrics_name http_status.${out_key} | |
| out_keys data.httpd.accesslog_2xx_count,data.httpd.accesslog_3xx_count,data.httpd.accesslog_404_count,data.httpd.accesslog_4xx_count,data.httpd.accesslog_5xx_count | |
| </match> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # service td-agent reload |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment