{"id":15515,"date":"2015-12-23T12:00:15","date_gmt":"2015-12-23T03:00:15","guid":{"rendered":"http:\/\/labs.gree.jp\/blog\/?p=15515"},"modified":"2015-12-22T12:52:12","modified_gmt":"2015-12-22T03:52:12","slug":"%e3%83%8d%e3%83%83%e3%83%88%e3%83%af%e3%83%bc%e3%82%af%e3%81%ae%e5%8f%af%e8%a6%96%e5%8c%96","status":"publish","type":"post","link":"https:\/\/labs.gree.jp\/blog\/2015\/12\/15515\/","title":{"rendered":"\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u53ef\u8996\u5316"},"content":{"rendered":"<p>GREE Advent Calendar 2015 \u306e23\u65e5\u76ee\u62c5\u5f53\u306e\u4e0a\u7af9\u3067\u3059\u3002\u666e\u6bb5\u306f\u30a2\u30d7\u30e9\u30a4\u30a2\u30f3\u30b9LB \u3084\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u69cb\u7bc9\/\u904b\u7528\u3092\u3057\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<h1>\u6982\u8981<\/h1>\n<p>\u30d0\u30c3\u30af\u30dc\u30fc\u30f3\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u8a2d\u8a08\u904b\u7528\u3057\u3066\u3044\u308b\u3068\u3001\u5b9f\u969b\u3069\u306e\u3088\u3046\u306a\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u304c\u3069\u306e\u304f\u3089\u3044\u6d41\u308c\u3066\u3044\u308b\u304b\u4e2d\u8eab\u3092\u77e5\u308a\u305f\u3044(\u898b\u305f\u3044)\u3053\u3068\u304c\u3088\u304f\u3042\u308a\u307e\u3059\u3002<br \/>\n\u3069\u306eISP \u304b\u3089\u3069\u306e\u56de\u7dda\u3078\u3069\u306e\u304f\u3089\u3044\u6d41\u5165\u304c\u3042\u308b\u306e\u304b\u3060\u3063\u305f\u308a\u3001\u3069\u3093\u306aAS \u304b\u3089\u3069\u306e\u304f\u3089\u3044\u30a2\u30af\u30bb\u30b9\u304c\u304d\u3066\u3044\u308b\u304b\u3001\u3053\u308c\u3089\u69d8\u3005\u306a\u60c5\u5831\u3092\u6b63\u3057\u304f\u628a\u63e1\u3059\u308b\u3053\u3068\u306f\u3001Transit \u56de\u7dda\u3084IX \u56de\u7dda\u3092\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3057\u4eca\u5f8c\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u6226\u7565\u3092\u8003\u3048\u308b\u3046\u3048\u3067\u975e\u5e38\u306b\u6709\u76ca\u3067\u3059\u3002<br \/>\n\u307e\u305f\u3001\u6628\u4eca\u6211\u3005\u3092\u60a9\u307e\u3057\u3066\u3044\u308bDDoS \u5bfe\u7b56\u306e\u7b2c\u4e00\u6b69\u3068\u3057\u3066\u3001\u4eca\u6d41\u308c\u3066\u3044\u308b\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u307e\u305a\"\u77e5\u308b\"\u3068\u3044\u3046\u3053\u3068\u304c\u5fc5\u8981\u3060\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u305d\u3053\u3067\u3001\u4eca\u56de\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u898b\u3048\u308b\u5316\u3092\u3001\u300cNetFlow\u300d\u3001\u300cFluentd + ElasticSearch + Kibana\u300d\u3092\u5229\u7528\u3057\u3066\u5b9f\u73fe\u3057\u307e\u3057\u305f\u3002<\/p>\n<h1>\u80cc\u666f<\/h1>\n<p>\u307e\u305a\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306e\u4e2d\u8eab\u3092\u8997\u304f\u624b\u6bb5\u304c\u5fc5\u8981\u3067\u3059\u3002\u3053\u308c\u3092\u62c5\u3046\u306e\u304cNetFlow \u3067\u3059\u3002<br \/>\nNetFlow \u3068\u306f\u3001Cisco \u304c1996 \u5e74\u306b\u958b\u767a\u3057\u305f\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u4e0a\u3092\u6d41\u308c\u3066\u3044\u308b\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u30e2\u30cb\u30bf\u30fc\u3059\u308b\u6a5f\u80fd\u3067\u3059\u3002<br \/>\n\u30e2\u30cb\u30bf\u30fc\u3057\u305f\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u30d5\u30ed\u30fc\u3054\u3068\u306b\u5206\u985e\u3057\u3001\u305d\u308c\u3089\u3092\u4efb\u610f\u306e\u5b9b\u5148\u3078\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002<br \/>\n\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u3055\u308c\u305f\u30d5\u30ed\u30fc\u60c5\u5831\u3092\u30ad\u30e3\u30c3\u30c1\u3057\u89e3\u6790\u3059\u308b\u57fa\u76e4\u304c\u5fc5\u8981\u3067\u3059\u3002\u3053\u306e\u89e3\u6790\u57fa\u76e4\u3092\u7528\u610f\u3059\u308b\u306b\u306f\u5927\u304d\u304f\u4ee5\u4e0b\u306e\u9078\u629e\u80a2\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u30a2\u30d7\u30e9\u30a4\u30a2\u30f3\u30b9\u88fd\u54c1\u3092\u8cfc\u5165\u3059\u308b<\/li>\n<li>\u516c\u958b\u3055\u308c\u3066\u3044\u308b\u30c4\u30fc\u30eb\u3092\u5c0e\u5165\u3059\u308b<\/li>\n<li>\u81ea\u524d\u3067\u7528\u610f\u3059\u308b<\/li>\n<\/ul>\n<p>\u30b0\u30ea\u30fc\u3067\u306f\u3001flow-tools \u3068\u3044\u3046\u516c\u958b\u3055\u308c\u3066\u3044\u308bNetFlow \u89e3\u6790\u30c4\u30fc\u30eb\u3092\u5c0e\u5165\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u30e1\u30f3\u30c6\u30ca\u30fc\u4e0d\u5728\u3060\u3063\u305f\u3053\u3068\u3001\u4f7f\u3044\u306b\u304f\u304f\u81ea\u7531\u5ea6\u304c\u4f4e\u3044\u3053\u3068\u3082\u3042\u3063\u3066\u3001\u4eca\u56de\u65b0\u305f\u306bOSS \u3067\u3042\u308bFluentd + ElasticSearch + Kibana \u3092\u4f7f\u7528\u3057\u3066\u89e3\u6790\u57fa\u76e4\u3092\u69cb\u7bc9\u3057\u307e\u3057\u305f\u3002<\/p>\n<h1>NetFlow \u3068\u306f<\/h1>\n<p>\u307e\u305a\u6700\u521d\u306b\u3001\u7c21\u5358\u306bNetFlow \u3068\u306f\u4f55\u304b\u306b\u3064\u3044\u3066\u89e6\u308c\u3066\u304a\u304d\u307e\u3059\u3002<br \/>\n\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u5206\u6790\u306b\u306f\u3001\u4ed6\u306bSNMP \u3068\u3044\u3046\u6280\u8853\u304c\u3088\u304f\u4f7f\u7528\u3055\u308c\u307e\u3059\u304c\u3001\u3053\u3061\u3089\u304c\u3042\u308b\u671f\u9593\u306b\u3069\u306e\u304f\u3089\u3044\u30d1\u30b1\u30c3\u30c8\u304c\u6d41\u308c\u3066\u3044\u305f\u304b\u306e\u7dcf\u91cf\u3092\u8a08\u6e2c\u3059\u308b\u306e\u306b\u5bfe\u3057\u3066\u3001NetFlow \u306f\u3042\u308b\u671f\u9593\u306b\u3069\u3093\u306a\u30d1\u30b1\u30c3\u30c8\u304c\u3069\u306e\u304f\u3089\u3044\u6d41\u308c\u3066\u3044\u305f\u304b\u7a2e\u5225\u3054\u3068\u306b\u8a08\u6e2c\u3057\u307e\u3059\u3002<br \/>\n\u305d\u306e\u7a2e\u5225\u306e\u8b58\u5225\u306b\u306f\u4ee5\u4e0b\u306e7\u3064 \u306e\u30ad\u30fc\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u9001\u4fe1\u5143IP \u30a2\u30c9\u30ec\u30b9<\/li>\n<li>\u5b9b\u5148IP \u30a2\u30c9\u30ec\u30b9<\/li>\n<li>\u9001\u4fe1\u5143\u30dd\u30fc\u30c8\u756a\u53f7<\/li>\n<li>\u5b9b\u5148\u30dd\u30fc\u30c8\u756a\u53f7<\/li>\n<li>L3 \u30d7\u30ed\u30c8\u30b3\u30eb<\/li>\n<li>TOS<\/li>\n<li>\u5165\u529b\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9<\/li>\n<\/ul>\n<p>\u3053\u308c\u30897 \u3064\u306e\u30ad\u30fc\u304c\u5168\u3066\u540c\u4e00\u3067\u3042\u308b\u5834\u5408\u3001\u540c\u3058\u30d5\u30ed\u30fc\u3068\u3057\u3066\u8b58\u5225\u3055\u308c\u307e\u3059\u3002(\u203b NetFlow version 9 \u3067\u306f\u3001\u3053\u306e\u30ad\u30fc\u3092\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002)<br \/>\n\u30d5\u30ed\u30fc\u306f\u69d8\u3005\u306a\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002\u4e0a\u8a187\u3064\u306e\u30ad\u30fc\u306f\u3082\u3061\u308d\u3093\u306e\u3053\u3068\u3001\u9001\u4fe1\u5143AS \u756a\u53f7\u3084\u30cd\u30af\u30b9\u30c8\u30db\u30c3\u30d7\u3084\u30d1\u30b1\u30c3\u30c8\u306ebytes \u306a\u3069\u69d8\u3005\u306a\u6709\u7528\u306a\u60c5\u5831\u3092\u5f97\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h1>\u30b7\u30b9\u30c6\u30e0\u6982\u8981<\/h1>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-15521\" src=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/advent_23_1-533x400.jpeg\" alt=\"advent_23_1\" width=\"533\" height=\"400\" srcset=\"https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/advent_23_1-533x400.jpeg 533w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/advent_23_1-267x200.jpeg 267w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/advent_23_1-768x576.jpeg 768w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/advent_23_1-830x623.jpeg 830w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/advent_23_1.jpeg 1024w\" sizes=\"auto, (max-width: 533px) 100vw, 533px\" \/><\/p>\n<h2>\u4f7f\u7528\u3057\u305f\u3082\u306e<\/h2>\n<ul>\n<li>\u30eb\u30fc\u30bf\u30fc\n<ul>\n<li>Cisco Catalyst 6500-E \u30b7\u30ea\u30fc\u30ba\u30b9\u30a4\u30c3\u30c1\n<ul>\n<li>NetFlow \u306bFlexible NetFlow \u6a5f\u80fd\u3092\u4f7f\u7528\u3057\u307e\u3059<\/li>\n<li>(\u30b0\u30ea\u30fc\u3067\u306f\u69d8\u3005\u306a\u30e1\u30fc\u30ab\u30fc\u306eNW \u6a5f\u5668\u3092\u904b\u7528\u3057\u3066\u304a\u308a\u307e\u3059\u304c\u3001\u4eca\u56de\u306f\u4e0a\u8a18\u3092\u4f8b\u306b\u3054\u8aac\u660e\u3057\u307e\u3059)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>\u4ee5\u4e0b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f\u306eLinux \u30b5\u30fc\u30d0\u30fc (\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5\u306f\u5272\u611b\u3055\u305b\u3066\u9802\u304d\u307e\u3059)\n<ul>\n<li>fluentd\n<ul>\n<li><a href=\"https:\/\/github.com\/uken\/fluent-plugin-elasticsearch\" target=\"_blank\">fluent-plugin-elasticsearch<\/a>, <a href=\"https:\/\/github.com\/y-ken\/fluent-plugin-geoip\" target=\"_blank\">fluent-plugin-geoip<\/a> \u306e2\u3064\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f7f\u7528\u3057\u307e\u3059<\/li>\n<\/ul>\n<\/li>\n<li>elasticsearch<\/li>\n<li>kibana4<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>\u4f55\u3092\u3059\u308b\u304b<\/h2>\n<ul>\n<li>\u30eb\u30fc\u30bf\u30fc\u3067\u53d6\u5f97\u3057\u305f\u30d5\u30ed\u30fc\u60c5\u5831\u3092fluentd \u306b\u6d41\u3057\u8fbc\u307felasticsearch \u3067\u89e3\u6790\u3057kibana4 \u3067\u8868\u793a\u3059\u308b<\/li>\n<li>\u9001\u4fe1\u5143\u30a2\u30c9\u30ec\u30b9\u304b\u3089GeoIP \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f7f\u3063\u3066\u4f4d\u7f6e\u60c5\u5831\u3092\u53d6\u5f97\u3057\u3066\u3001kibana4 \u306eTile Map \u306b\u8868\u793a\u3059\u308b<\/li>\n<\/ul>\n<h1>Flexible Flow \u306e\u8a2d\u5b9a<\/h1>\n<p>\u6700\u521d\u306bFlexible Flow \u306e\u8a2d\u5b9a\u3092\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a \u3001exporter \u306e\u8a2d\u5b9a\u3092\u3057\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u30c7\u30fc\u30bf\u3092\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u3059\u308b\u5b9b\u5148\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002<br \/>\n\u5f0a\u793e\u3067\u306f\u3001\u4e00\u90e8\u30eb\u30fc\u30bf\u30fc\u306b\u3066\u4f1d\u7d71\u7684\u306aNetflow v5 \u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u7d4c\u7def\u304c\u3042\u308a\u3001\u305d\u3061\u3089\u306b\u5206\u6790\u3059\u308b\u969b\u306e\u30c7\u30fc\u30bf\u30b9\u30ad\u30fc\u30de\u306b\u3042\u308f\u305b\u308b\u305f\u3081\u3001Flexible Flow \u3067\u3082 <code>netflow-v5<\/code> \u3068\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002(\u203b v9 \u306b\u306f\u3001v5 \u3068\u306e\u4e0b\u4f4d\u4e92\u63db\u6027\u304c\u3042\u308a\u307e\u305b\u3093\u3002)<\/p>\n<blockquote><p>\n  <strong>flow exporter<\/strong> <em>exporter-name<\/em><br \/>\n  <strong>destination<\/strong> {<em>ip-address<\/em> | <em>hostname<\/em>}<br \/>\n  <strong>source<\/strong> <em>interface-type<\/em> <em>interface-number<\/em><br \/>\n  <strong>transport udp<\/strong> <em>udp-port<\/em><br \/>\n  <strong>export-protocol netflow-v5<\/strong>\n<\/p><\/blockquote>\n<p>\u6b21\u306b\u3001monitor \u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3057\u307e\u3059\u3002\u4e0a\u8a18\u3067\u8a2d\u5b9a\u3057\u305fexporter \u3092\u9069\u7528\u3057\u3001\u3069\u306erecord \u3092\u4f7f\u7528\u3059\u308b\u304b\u5b9a\u7fa9\u3057\u307e\u3059\u3002<br \/>\nv5 \u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u3001\u3042\u3089\u304b\u3058\u3081\u7528\u610f\u3055\u308c\u3066\u3044\u308brecord \u3067\u3042\u308b <code>platform-original<\/code> \u3057\u304b\u4f7f\u7528\u3067\u304d\u307e\u305b\u3093\u3002IPv4 \u306e\u5168\u3066\u306e\u30d5\u30ed\u30fc\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u53d6\u5f97\u3067\u304d\u308b\u3088\u3046\u306b <code>ipv4 full<\/code> \u3068\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\nv9 \u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u3001<code>flow record<\/code> \u3092\u4f7f\u7528\u3057\u3066\u3001\u30e6\u30fc\u30b6\u5b9a\u7fa9\u306erecord \u3092\u4f5c\u6210\u3057\u9069\u7528\u3067\u304d\u307e\u3059\u3002\u4f55\u3092\u30ad\u30fc\u3068\u3059\u308b\u304b\u3001\u3069\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u53d6\u5f97\u3059\u308b\u304b\u3092\u4efb\u610f\u306b\u8a2d\u5b9a\u3067\u304d\u307e\u3059\u3002<\/p>\n<blockquote><p>\n  <strong>flow monitor<\/strong> <em>monitor-name<\/em><br \/>\n  <strong>exporter<\/strong> <em>exporter-name<\/em><br \/>\n  <strong>record platform-original ipv4 full<\/strong>\n<\/p><\/blockquote>\n<p>\u6700\u5f8c\u306b\u3001sampler \u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<br \/>\n\u3053\u3053\u3067\u306f\u30b5\u30f3\u30d7\u30ea\u30f3\u30b0\u7387\u3092\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002\u30eb\u30fc\u30bf\u30fc\u306e\u8ca0\u8377\u3092\u8003\u616e\u3057\u3066\u3001\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<blockquote><p>\n  <strong>flow sampler<\/strong> <em>sampler-name<\/em><br \/>\n  <strong>mode random 1 out of<\/strong> <em>rate<\/em>\n<\/p><\/blockquote>\n<p>\u4ee5\u4e0a\u3067\u5fc5\u8981\u306a\u3082\u306e\u306f\u63c3\u3063\u305f\u306e\u3067\u3001\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306b\u9069\u7528\u3057\u3066\u3044\u304d\u307e\u3059\u3002<br \/>\n\u4eca\u56de\u306f\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u304b\u3089\u81ea\u7db2\u5185\u306b\u5165\u3063\u3066\u304f\u308b\u30d5\u30ed\u30fc\u3092\u5206\u6790\u3057\u305f\u3044\u305f\u3081\u3001\u5bfe\u8c61\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306ein \u306b\u9069\u7528\u3057\u307e\u3059\u3002<\/p>\n<blockquote><p>\n  <strong>ip flow monitor<\/strong> <em>monitor-name<\/em> <strong>input sampler<\/strong> <em>sampler-name<\/em>\n<\/p><\/blockquote>\n<h1>fluentd \u306e\u8a2d\u5b9a<\/h1>\n<p>\u307e\u305a\u306f\u3001&lt;source&gt; \u3067\u30eb\u30fc\u30bf\u30fc\u304b\u3089\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u3055\u308c\u305f\u30d5\u30ed\u30fc\u3092fluentd \u3067\u30ad\u30e3\u30c3\u30c1\u3057\u307e\u3059\u3002Flexible NetFlow \u306eexporter \u3067\u8a2d\u5b9a\u3057\u305fUDP \u30dd\u30fc\u30c8\u756a\u53f7\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 \u3053\u3061\u3089\u3067<a href=\"https:\/\/github.com\/uken\/fluent-plugin-elasticsearch\">fluent-plugin-elasticsearch<\/a>\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">&lt;source&gt;\ntype netflow\ntag geo.netflow\nport {udp_port}\n&lt;\/source&gt;<\/pre>\n<p>\u6b21\u306b\u3001<a href=\"https:\/\/github.com\/y-ken\/fluent-plugin-geoip\">fluent-plugin-geoip<\/a> \u3092\u4f7f\u7528\u3057\u3066\u3001\u9001\u4fe1\u5143\u30a2\u30c9\u30ec\u30b9\u3092\u30ad\u30fc\u3068\u3057\u3066 <code>geoip_lookup_key ipv4_src_addr<\/code> GeoIP \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u691c\u7d22\u3057\u3001\u56fd\u30b3\u30fc\u30c9\u3084\u7def\u5ea6\u7d4c\u5ea6\u3092\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002<br \/>\n\u3053\u3053\u3067\u91cd\u8981\u306a\u306e\u306f\u3001Kibana4 \u306eTile Map \u3092\u4f7f\u7528\u3059\u308b\u306b\u306felasticsearch \u306e<a href=\"https:\/\/www.elastic.co\/guide\/en\/elasticsearch\/reference\/1.4\/mapping-geo-point-type.html\">Geo Point Type<\/a> \u304c\u5fc5\u8981\u3068\u306a\u308b\u305f\u3081\u3001\u305d\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306b\u5f93\u3063\u305f\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u7528\u610f\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u4e0b\u306e\u4f8b\u3067\u306f\u3001 <code>geoip_pin<\/code> \u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u8ffd\u52a0\u3057\u3066 <code>lat,lon<\/code> \u3068\u3044\u3046\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3092\u63a1\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\"><match geo.netflow>\ntype geoip\ngeoip_lookup_key ipv4_src_addr\n\ngeoip_country ${country_code['ipv4_src_addr']}\ngeoip_city ${city['ipv4_src_addr']}\ngeoip_lat ${latitude['ipv4_src_addr']}\ngeoip_lon ${longitude['ipv4_src_addr']}\ngeoip_pin ${latitude[\"ipv4_src_addr\"]},${longitude[\"ipv4_src_addr\"]}\n\nremove_tag_prefix geo.\nadd_tag_prefix es.\nskip_adding_null_record\n<\/match><\/pre>\n<p>\u6700\u5f8c\u306b\u3001\u30c7\u30fc\u30bf\u3092elasticsearch \u3078netflow \u30bf\u30a4\u30d7\u3068\u3057\u3066\u9001\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\"><match es.netflow>\ntype elasticsearch\nhost {elasticsearch host}\nport {elasticsearch port}\ntype_name netflow\nlogstash_format true\nlogstash_prefix flow\nlogstash_dateformat %Y%m%d\n<\/match><\/pre>\n<h1>elasticsearch \u306e\u8a2d\u5b9a<\/h1>\n<p>elasticsearch \u306e\u8a2d\u5b9a\u306f\u7279\u306b\u5fc5\u8981\u3042\u308a\u307e\u305b\u3093\u3002<br \/>\ntd-agent \u304b\u3089\u9001\u3089\u308c\u3066\u304d\u305f\u30c7\u30fc\u30bf\u304c\u65e5\u6b21index (flow-20151223\u3068\u304b)\u306b\u81ea\u52d5\u7684\u306b\u3069\u3093\u3069\u3093\u84c4\u7a4d\u3055\u308c\u3066\u3044\u304d\u307e\u3059\u3002<br \/>\n\u305f\u3060\u3001fluentd \u3067\u8ffd\u52a0\u3057\u305f<code>geoip_pin<\/code> \u30d5\u30a3\u30fc\u30eb\u30c9\u304cgeo_point type \u578b\u3067\u3042\u308b\u3053\u3068\u3092elasticsearch \u306b\u77e5\u3089\u305b\u3066\u3084\u3089\u306a\u3051\u308c\u3070\u3044\u3051\u307e\u305b\u3093\u3002<br \/>\n(\u305d\u306e\u4ed6\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u3064\u3044\u3066\u306f\u3001\u81ea\u52d5\u7684\u306bstring \u578b\u3084number \u578b\u3068\u8a8d\u8b58\u3055\u308c\u307e\u3059\u3002)<br \/>\n\u3053\u306e\u305f\u3081\u3001flow-* \u3068\u3044\u3046index \u306b\u9069\u7528\u3055\u308c\u308b\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u767b\u9332\u3057\u307e\u3059\u3002<\/p>\n<pre><code>curl -XPUT {elasticsearch host}:{elasticsearch port}\/_template\/flow -d '\n{\n  \"template\" : \"flow-*\",\n  \"mappings\" : {\n    \"netflow\" : {\n      \"properties\" : {\n        \"@timestamp\" : {\n          \"type\" : \"date\",\n          \"format\" : \"dateOptionalTime\"\n        },\n        \"ipv4_src_addr\" : {\n          \"type\" : \"string\"\n        :\n        :\n        \"geoip_pin\" : {\n          \"type\" : \"geo_point\"\n        },\n        :\n        :\n      }\n   }\n}'\n<\/code><\/pre>\n<h1>kibana4 \u306e\u8a2d\u5b9a<\/h1>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306bindex pattern \u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/advent_23_2-600x264.png\" alt=\"advent_23_2\" width=\"600\" height=\"264\" class=\"alignnone size-medium wp-image-15675\" srcset=\"https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/advent_23_2-600x264.png 600w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/advent_23_2-276x121.png 276w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/advent_23_2-768x337.png 768w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/advent_23_2-830x365.png 830w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><br \/>\n\u3042\u3068\u306f\u597d\u304d\u306a\u69d8\u306b\u30dd\u30c1\u30dd\u30c1\u3057\u3066\u697d\u3057\u304f\u53ef\u8996\u5316\u3059\u308b\u3060\u3051\u3067\u3059\u3002<br \/>\ngeo_point \u578b\u3067\u3042\u308b<code>geoip_pin<\/code> \u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u8ffd\u52a0\u3057\u305f\u3053\u3068\u3067\u3001\u9001\u4fe1\u5143\u30a2\u30c9\u30ec\u30b9\u3092\u5143\u306b\u3057\u305f\u69d8\u3005\u306a\u30d2\u30fc\u30c8\u30de\u30c3\u30d7\u3084\u30de\u30fc\u30ab\u30fc\u30de\u30c3\u30d4\u30f3\u30b0\u3092\u7c21\u5358\u306b\u8868\u793a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/advent_23_3-567x400.png\" alt=\"advent_23_3\" width=\"600\" height=\"400\" class=\"alignnone size-medium wp-image-15676\" \/><\/p>\n<h1>\u307e\u3068\u3081<\/h1>\n<p>\u4eca\u56de\u3001Netflow \u3068OSS \u30c4\u30fc\u30eb\u3092\u5229\u7528\u3057\u3066\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u53ef\u8996\u5316\u3092\u5b9f\u73fe\u3059\u308b\u65b9\u6cd5\u3092\u7c21\u5358\u306b\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002\u300c\u898b\u3048\u308b\u5316\u300d\u3092\u3059\u308b\u3053\u3068\u3067\u3001\u4eca\u307e\u3067\u7c21\u5358\u306b\u5f97\u308b\u3053\u3068\u304c\u3067\u304d\u306a\u304b\u3063\u305f\u60c5\u5831\u3092\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u306b\u76f4\u611f\u7684\u306b\u5f97\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u305d\u3057\u3066\u4f55\u3088\u308a\u76ee\u306b\u898b\u3048\u308b\u5f62\u306b\u4f55\u304b\u3092\u30a2\u30a6\u30c8\u30d7\u30c3\u30c8\u3059\u308b\u3053\u3068\u306f\u697d\u3057\u3044\u3067\u3059\u3002\u305f\u3060\u3057\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\"\u77e5\u308b\"\u3053\u3068\u3067\u6e80\u8db3\u305b\u305a\u3001\u6b21\u306e\u30a2\u30af\u30b7\u30e7\u30f3\u306b\u6d3b\u304b\u3057\u3066\u3044\u3053\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u660e\u65e5\u306f\u6e21\u90e8\u3055\u3093\u306e\u6d88\u6ec5\u90fd\u5e02\u306e\u304a\u8a71\u3067\u3059\u3002\u304a\u697d\u3057\u307f\u306b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>GREE Advent Calendar 2015 \u306e23\u65e5\u76ee\u62c5\u5f53\u306e\u4e0a\u7af9\u3067\u3059\u3002\u666e\u6bb5\u306f\u30a2\u30d7\u30e9\u30a4\u30a2\u30f3\u30b9LB \u3084\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u69cb\u7bc9\/\u904b\u7528\u3092\u3057\u3066\u304a\u308a\u307e\u3059\u3002 \u6982\u8981 \u30d0\u30c3\u30af\u30dc\u30fc\u30f3\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u8a2d\u8a08\u904b\u7528\u3057\u3066\u3044\u308b\u3068\u3001\u5b9f\u969b\u3069\u306e\u3088\u3046\u306a\u30c8\u30e9\u30d5 [&hellip;]<\/p>\n","protected":false},"author":155,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[],"tags":[54,26],"class_list":["post-15515","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","tag-advent-calendar","tag-nw"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/posts\/15515","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/users\/155"}],"replies":[{"embeddable":true,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/comments?post=15515"}],"version-history":[{"count":3,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/posts\/15515\/revisions"}],"predecessor-version":[{"id":15702,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/posts\/15515\/revisions\/15702"}],"wp:attachment":[{"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/media?parent=15515"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/categories?post=15515"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/tags?post=15515"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}