{"id":4396,"date":"2014-08-09T02:18:54","date_gmt":"2014-08-08T17:18:54","guid":{"rendered":"http:\/\/www.vincentina.net\/?p=4396"},"modified":"2014-08-09T02:18:54","modified_gmt":"2014-08-08T17:18:54","slug":"fluentd%e3%82%92%e3%81%95%e3%82%8f%e3%81%a3%e3%81%a6%e3%81%bf%e3%81%9f%e3%82%8f%e3%81%91%e3%81%a7","status":"publish","type":"post","link":"https:\/\/www.vincentina.net\/?p=4396","title":{"rendered":"fluentd\u3092\u3055\u308f\u3063\u3066\u307f\u305f\u308f\u3051\u3067"},"content":{"rendered":"<p>\u6700\u8fd1\u3088\u304f\u51fa\u3066\u304d\u305f\u30ad\u30fc\u30ef\u30fc\u30c9\u3068\u3044\u3046\u304b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u3055\u3089\u308a\u3068\u5e7e\u3064\u304b\u4e0a\u3052\u3066\u307f\u308b\u3068<\/p>\n<p>monit\u30fbsupervisor\u30fbzabbix\u30fbopenflow\u30fbfluentd\u30fbdocker\u30fbopenstack\uff1f<\/p>\n<p>\u306a\u3069\u306a\u3069\u3067\u3059\u304c\u3001\u3053\u306e\u8fba\u306f\u3059\u3079\u3066\u3001<strong><span style=\"font-size: 14pt;\">\uff5e\uff5e\u3092\u4e00\u62ec\u3067\uff5e\uff5e\u3067\u304d\u308b\u3088\uff01\uff01<\/span><\/strong>\u3068\u3044\u3046\u3084\u3046\u306a\u3082\u306e\u3067\u3059\u304c\u3001\u6700\u8fd1\u306e\u30c8\u30ec\u30f3\u30c9\u3068\u3044\u3046\u304b\u3001\u6d41\u884c\u308a\u3068\u3044\u3046\u304b\u3001\u3053\u308c\u304c\u4eca\u306e\u6642\u4ee3\u306a\u611f\u3058\u3068\u601d\u308f\u308c\u3002<\/p>\n<p>\u514e\u3082\u89d2\u3001\u8272\u3005\u3068\u30af\u30e9\u30a6\u30c9\u5316\u306a\u308f\u3051\u3067\u3001\u305d\u308c\u306f\u3068\u3063\u3066\u3082\u5927\u898f\u6a21\u306a\u308f\u3051\u3067\u3001\u305d\u3046\u306a\u3063\u3066\u304f\u308b\u3068\u3084\u3063\u3071\u308a\u4e00\u62ec\u7ba1\u7406\u3068\u3044\u3046\u306e\u306f\u5927\u4e8b\u306a\u308f\u3051\u3067\u3002<\/p>\n<p>fluentd\u3068\u3044\u3046\u306e\u3082\u30ed\u30b0\u306e\u4e00\u62ec\u7ba1\u7406\u304c\u3067\u304d\u308b\u3082\u306e\u3067\u3001\u81ea\u5206\u304c\u4f7f\u3046\u306e\u304b\u3069\u3046\u304b\u306f\u7f6e\u3044\u3066\u304a\u3044\u3066\u3001\u3061\u3087\u3053\u3063\u3068\u89e6\u3063\u3066\u307f\u305f\u308f\u3051\u3067\u3002<\/p>\n<h3>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u307f\u308b<\/h3>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\u306f\u3001ruby\u3092\u4f7f\u3063\u3066\u3044\u308b\u306e\u3067gem\u3067\u5165\u308c\u308b\u304b<\/p>\n<pre>gem install fluentd --no-ri --no-rdoc<\/pre>\n<p>rpm\u30d1\u30c3\u30b1\u30fc\u30b8\u304b\u3089Fluentd\u3092\u5165\u308c\u308b\u304b\u306e\u3069\u3061\u3089\u304b\u306a\u6a21\u69d8\u3002<\/p>\n<pre>curl -L http:\/\/toolbelt.treasuredata.com\/sh\/install-redhat.sh | sh<\/pre>\n<p>\u3053\u3053\u306f\u307e\u3041\u3001\u5b89\u5b9a\u7248\u306erpm\u306e\u65b9\u3067\u9032\u3081\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u307e\u305a\u3001\u516c\u5f0f\u306b\u6ce8\u610f\u66f8\u304d\u304c\u3057\u3066\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre>\u30ed\u30b0\u5185\u306b\u7121\u52b9\u306a\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u304c\u5165\u308b\u3053\u3068\u3092\u9632\u3050\u305f\u3081\u306b\r\n\u30ce\u30fc\u30c9\u4e0a\u3067ntpd\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u3092\u5f37\u304f\u304a\u52e7\u3081\u3057\u307e\u3059\u3002<\/pre>\n<p>\u3068\u3044\u3046\u4e8b\u306a\u306e\u3067\u3001\u3084\u3063\u3068\u304f\u306e\u304c\u5927\u5409\u306a\u308f\u3051\u3067\u3002<\/p>\n<pre># sudo yum list ntp\r\nInstalled Packages\r\nntp.x86_64\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 4.2.6p5-1.el6\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 @anaconda-ScientificLinux-201401271129.x86_64<\/pre>\n<p>\u3042\u306a\u3053\u3093\u3060\u3002\u3055\u3042\u5165\u3063\u305f\uff01\u3068\u3001\u305d\u306e\u524d\u306b\u3001monlist\u6a5f\u80fd\u306e\u7121\u52b9\u3092\u3057\u306a\u3044\u3068\u306d\u3002<br \/>\n\u5929\u707d\u306f\u5fd8\u308c\u305f\u3053\u308d\u306b\u3084\u3063\u3066\u304f\u308b\u308f\u3051\u3067\u3002<\/p>\n<pre># vi \/etc\/ntp.conf\r\ndisable monitor<\/pre>\n<p>\u3053\u3093\u306a\u98a8\u306bdisable monitor\u3092\u8ffd\u52a0\u3057\u3066\u304a\u3053\u3046\u3002<\/p>\n<p>\u3067\u306f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u9032\u307f\u307e\u3059\u3002<\/p>\n<pre>curl -L http:\/\/toolbelt.treasuredata.com\/sh\/install-redhat.sh | sh<\/pre>\n<p>\u3053\u306e\u30b3\u30de\u30f3\u30c91\u3064\u3067\u30ec\u30dd\u30b8\u30c8\u30ea\u306e\u8ffd\u52a0\u3068\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u307e\u3067\u5168\u90e8\u3084\u3063\u3066\u304f\u308c\u308b\u3088\u3046\u3067\u3059\u3002<br \/>\n\u3067\u306f\u8d77\u52d5\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre># sudo\u00a0 \/etc\/init.d\/td-agent start\r\nStarting td-agent:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 [\u00a0 OK\u00a0 ]<\/pre>\n<p>\u306a\u3093\u306a\u304f\u8d77\u52d5\u3057\u307e\u3057\u305f\u3002<\/p>\n<h3>\u8a66\u3057\u306b\u30ed\u30b0\u3092\u62fe\u3063\u3066\u307f\u308b\u3068<\/h3>\n<p>\u3072\u3068\u307e\u305a\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u7d42\u308f\u3063\u305f\u3089\u3001\u30c6\u30b9\u30c8\u3002<\/p>\n<pre># curl -X POST -d 'json={\"json\":\"message\"}' http:\/\/localhost:8888\/debug.test\r\n\r\n# tail -n1 \/var\/log\/td-agent\/td-agent.log\r\n2014-08-09 00:48:19 +0900 debug.test: {\"json\":\"message\"}<\/pre>\n<p>\u3053\u308c\u3067\u8868\u793a\u3055\u308c\u308c\u3070\u3001\uff2f\uff2b\u3068\u601d\u308f\u308c\u3002<\/p>\n<p>\u3067\u306f\u3001\u8272\u3005\u3068\u30b5\u30a4\u30c8\u3092\u5de1\u3063\u3066\u51fa\u6765\u4e0a\u304c\u3063\u305fconf\u30d5\u30a1\u30a4\u30eb\u306f\u3053\u3093\u306a\u611f\u3058\u3067\u3059\u3002apache\u306e\u30ed\u30b0\u3092\u5225\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u8a18\u8ff0\u3059\u308b\u3068\u3044\u3046\u3001\u610f\u5473\u3092\u8003\u3048\u3066\u306f\u3044\u3051\u306a\u3044\u3082\u306e\u306a\u308f\u3051\u3067\u3002<\/p>\n<pre># cat \/etc\/td-agent\/td-agent.conf\r\n## Input\r\n&lt;source&gt;\r\n\u00a0 type tail\r\n\u00a0 path \/var\/log\/httpd\/access_log\r\n\u00a0 format apache2\r\n\u00a0 pos_file \/var\/log\/td-agent\/tmp\/apache.access.log.pos\r\n\u00a0 tag apache.access\r\n&lt;\/source&gt;\r\n\r\n## Output\r\n&lt;match apache.access&gt;\r\n\u00a0\u00a0\u00a0 type file\r\n\u00a0\u00a0\u00a0 path \/var\/log\/td-agent\/apache.access\r\n\u00a0\u00a0\u00a0 time_slice_format %Y%m%d\r\n\u00a0\u00a0\u00a0 time_format %Y%m%dT%H%M%S%z\r\n&lt;\/match&gt;<\/pre>\n<p>\u3067\u306f\u9806\u756a\u306b\u5fd8\u5099\u9332\u3066\u304d\u306a\u611f\u3058\u3067\u66f8\u3044\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u57fa\u672c\u3067\u3059\u304c\u3001conf\u30d5\u30a1\u30a4\u30eb\u306e\u4e2d\u8eab\u306fsource\u3068match\u306b\u5206\u304b\u308c\u307e\u3059\u304c\u3001source\u306b\u8a18\u8ff0\u3059\u308b\u3082\u306e\u306f\u5143\u30ed\u30b0\u2192fluentd\u3067\u3001match\u306b\u8a18\u8ff0\u3059\u308b\u3082\u306e\u306ffluentd\u2192\u30ed\u30b0\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u6700\u521d\u306b\u66f8\u3044\u305f\u3088\u3046\u306b\u3001\u4e00\u62ec\u7ba1\u7406\u3059\u308b\u4e8b\u306b\u9577\u3051\u3066\u3044\u308b\u306e\u3067\u3001match\u306b\u8907\u6570\u306e\u30b5\u30fc\u30d0\u30fc\u3092\u8a18\u8ff0\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\u3082\u3063\u3068\u3082\u3063\u3068\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u305d\u3093\u306a\u611f\u3058\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u30fbtype<br \/>\n\u30a4\u30f3\u30d7\u30c3\u30c8\u306e\u30bf\u30a4\u30d7\u3001\u30a2\u30a6\u30c8\u30d7\u30c3\u30c8\u306e\u30bf\u30a4\u30d7\u3092\u6307\u3057\u3066\u3044\u3066\u3001\u306a\u3093\u3068\u306a\u304f\u5358\u8a9e\u306e\u610f\u5473\u305d\u306e\u307e\u307e\u306e\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>\u30fbpath<br \/>\n\u3053\u3061\u3089\u3082\u3001\u5358\u8a9e\u305d\u306e\u307e\u307e\u306e\u610f\u5473\u3067\u3059\u304c\u3001\u6a29\u9650\u306b\u6ce8\u610f\u3057\u306a\u3044\u3068\u4e0a\u624b\u304f\u52d5\u304b\u306a\u3044\u306e\u3067\u6ce8\u610f\u7b87\u6240\u3067\u3057\u305f\u3002<\/p>\n<p>\u30fbformat<br \/>\n\u3053\u3061\u3089\u306f\u30ed\u30b0\u3092\u30d1\u30fc\u30b9\u3059\u308b\u3082\u306e\u3067\u3001\u6709\u540d\u306a\u3082\u306e\u3067\u3042\u308c\u3070\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306a\u611f\u3058\u3067apache2\u3068\u304b\u3067\u304d\u307e\u3059\u3002\u30aa\u30ea\u30b8\u30ca\u30eb\u306a\u3053\u3068\u3082\u3067\u304d\u308b\u6a21\u69d8\u3002<\/p>\n<p>\u30fbpos_file<br \/>\n\u30d5\u30a1\u30a4\u30eb\u306e\u66f8\u304d\u8fbc\u307f\u306b\u4f7f\u3063\u3066\u3044\u308b\u30d0\u30c3\u30d5\u30a1\u307f\u305f\u3044\u306a\u611f\u3058\uff08\u305f\u3076\u3093\uff09\u3002<\/p>\n<p>\u307b\u304b\u306b\u3082\u3042\u308b\u3051\u308c\u3069\u3001\u3060\u3044\u305f\u3044\u3053\u3093\u306a\u611f\u3058\u3067\u3059\u306d\u3002<\/p>\n<p><strong><span style=\"font-size: 12pt;\">\u3067\u306f\uff01<\/span><\/strong>\u53d6\u308c\u305f\u30ed\u30b0\u3092\u898b\u3066\u307f\u308b\u3068\u3053\u3093\u306a\u98a8\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre>\u00a0# tail -1 \/var\/log\/td-agent\/apache.access.20140809.b50020b1bf23e9610\r\n20140808T163247+0000\u00a0\u00a0\u00a0 apache.access\u00a0\u00a0 {\"host\":\"***.***.***.***\",\"user\":null,\"method\":\"GET\",\"path\":\"\/\",\"code\":403,\"size\":3822,\"referer\":null,\"agent\":\"Mozilla\/5.0 (compatible; Baiduspider\/2.0; +http:\/\/www.baidu.com\/search\/spider.html)\"}<\/pre>\n<p>\u3046\u3080\u3001\u975e\u5e38\u306b\u898b\u3084\u3059\u304f\u306a\u3063\u3066\u304a\u308a\u307e\u3059\u3002\u3057\u304b\u3082\u3001\u3053\u3044\u3064\u306f\u65e2\u5b58\u306e\u30ed\u30b0\u306f\u305d\u306e\u307e\u307e\u3002<\/p>\n<p>\u3053\u3046\u3044\u3046\u98a8\u306b\u5e7e\u3064\u3082\u306e\u30b5\u30fc\u30d0\u30fc\u306e\u30ed\u30b0\u3092\u6574\u5f62\u3057\u3066\u3001\u4e00\u62ec\u3067\u30ed\u30b0\u30b5\u30fc\u30d0\u30fc\u3068\u3057\u3066\u7ba1\u7406\u3067\u304d\u308b\u3068\u3044\u3046\u4e8b\u304c\u53ef\u80fd\u306b\u306a\u3063\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u3060\u3044\u3076\u524d\u306bopenstack\u3092\u89e6\u308a\u307e\u3057\u305f\u304c\u3001\u30af\u30e9\u30a6\u30c9\u74b0\u5883\u306b\u306f\u304b\u306a\u308a\u4f7f\u3048\u305d\u3046\u306a\u611f\u3058\u3067\u3059\u306d\u3002<\/p>\n<p>\u305d\u308d\u305d\u308d\u304a\u76c6\u3067\u3059\u306a\u3041\u3002<\/p>\n<p>&nbsp;<\/p>\n<div class='wp_social_bookmarking_light'>        <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"https:\/\/www.vincentina.net\/?p=4396\" data-text=\"fluentd\u3092\u3055\u308f\u3063\u3066\u307f\u305f\u308f\u3051\u3067\" data-via=\"TakekenTw\" data-lang=\"ja\">Tweet<\/a><\/div><\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u3088\u304f\u51fa\u3066\u304d\u305f\u30ad\u30fc\u30ef\u30fc\u30c9\u3068\u3044\u3046\u304b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u3055\u3089\u308a\u3068\u5e7e\u3064\u304b\u4e0a\u3052\u3066\u307f\u308b\u3068 monit\u30fbsupervisor\u30fbzabbix\u30fbopenflow\u30fbfluentd\u30fbdocker\u30fbopenstack\uff1f \u306a\u3069\u306a\u3069\u3067\u3059\u304c\u3001\u3053\u306e\u8fba\u306f\u3059\u3079 &hellip; <a href=\"https:\/\/www.vincentina.net\/?p=4396\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;fluentd\u3092\u3055\u308f\u3063\u3066\u307f\u305f\u308f\u3051\u3067&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-4396","post","type-post","status-publish","format-standard","hentry","category-server"],"_links":{"self":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/posts\/4396","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4396"}],"version-history":[{"count":0,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/posts\/4396\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4396"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4396"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4396"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}