{"id":15237,"date":"2015-12-17T12:00:34","date_gmt":"2015-12-17T03:00:34","guid":{"rendered":"http:\/\/labs.gree.jp\/blog\/?p=15237"},"modified":"2015-12-17T03:54:01","modified_gmt":"2015-12-16T18:54:01","slug":"varnish%e3%81%aemodule%e3%82%92%e4%bd%9c%e3%81%a3%e3%81%a6%e3%81%bf%e3%82%88%e3%81%86%e5%85%a5%e9%96%80%e7%b7%a8","status":"publish","type":"post","link":"https:\/\/labs.gree.jp\/blog\/2015\/12\/15237\/","title":{"rendered":"Varnish\u306emodule\u3092\u4f5c\u3063\u3066\u307f\u3088\u3046(\u5165\u9580\u7de8)"},"content":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001Service Engineering\u30c1\u30fc\u30e0\u306e\u3044\u308f\u306a\u3061\u3083\u3093\u3055\u3093(@xcir)\u3067\u3059\u3002<br \/>\n\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u306fGREE Advent Calendar 2015\u3068Varnish Cache Advent Calendar 2015\u306e17\u65e5\u76ee\u306e\u8a18\u4e8b\u3067\u3059\u3002<\/p>\n<h3>\u306f\u3058\u3081\u306b<\/h3>\n<p>Apache\u3084Nginx\u306bmodule\u304c\u3042\u308b\u3088\u3046\u306bVarnish\u306b\u3082Module(Varnish Module \/ VMOD)\u3068\u3044\u3046\u4ed5\u7d44\u307f\u304c\u5b58\u5728\u3057\u307e\u3059\u3002<br \/>\n\u516c\u5f0f\u306b\u591a\u304f\u306e<a href=\"https:\/\/www.varnish-cache.org\/vmods\">VMOD<\/a>\u304c\u30ea\u30b9\u30c8\u3055\u308c\u3066\u304a\u308a\u6a5f\u80fd\u306f\u591a\u5c90\u306b\u6e21\u308a\u307e\u3059\u3002<br \/>\n\u5c11\u3057\u7d39\u4ecb\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong><a href=\"https:\/\/github.com\/varnish\/libvmod-digest\/tree\/4.1\">libvmod-digest<\/a><\/strong><br \/>\nhmac_sha256\u3084hash_sha256\u306a\u3069\u306e\u69d8\u3005\u306a\u30c0\u30a4\u30b8\u30a7\u30b9\u30c8\u3092\u4f5c\u6210\u3059\u308b\u30e2\u30b8\u30e5\u30fc\u30eb\u3067\u3059\u3002<br \/>\n\u5fdc\u7528\u7bc4\u56f2\u304c\u5e83\u304fURL\u306e\u6539\u7ac4\u30c1\u30a7\u30c3\u30af\u3084\u4e00\u5b9a\u6642\u9593\u6709\u52b9\u306aURL\u306a\u3069\u69d8\u3005\u306a\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p><strong><a href=\"https:\/\/code.uplex.de\/uplex-varnish\/libvmod-vslp\">libvmod-vslp<\/a><\/strong><br \/>\nVarnish\u3067\u6a19\u6e96\u3067\u7528\u610f\u3057\u3066\u3044\u308b\u632f\u308a\u5206\u3051\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0(\u3053\u308c\u3082<a href=\"https:\/\/www.varnish-cache.org\/docs\/trunk\/reference\/vmod_directors.generated.html\">Directors<\/a>\u3068\u3044\u3046VMOD\u3067\u5b9f\u73fe\u3055\u308c\u3066\u3044\u307e\u3059)\u306f\u30b3\u30f3\u30b7\u30b9\u30c6\u30f3\u30c8\u30cf\u30c3\u30b7\u30e5\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u3053\u306eVMOD\u3067\u306f\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><strong><a href=\"https:\/\/github.com\/carlosabalde\/libvmod-redis\">libvmod-redis<\/a><\/strong><br \/>\n\u540d\u524d\u306e\u901a\u308aVCL\u4e2d\u304b\u3089Redis\u306b\u5bfe\u3057\u3066\u30a2\u30af\u30bb\u30b9\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><strong><a href=\"https:\/\/github.com\/xcir\/libvmod-awsrest\">libvmod-awsrest<\/a><\/strong><br \/>\nS3\u306a\u3069\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u306a\u30b7\u30b0\u30cd\u30c1\u30e3\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>\u306a\u3069\u306a\u3069\u3001\u69d8\u3005\u306aVMOD\u304c\u5b58\u5728\u3057\u307e\u3059\u3002<br \/>\n\u307e\u305f\u3001VMOD\u306f\u4f8b\u3048\u3070libvmod-digest\u306e\u3088\u3046\u306b\u305f\u3060\u30c0\u30a4\u30b8\u30a7\u30b9\u30c8\u3092\u4f5c\u308b\u3060\u3051\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u3060\u3068\u3057\u3066\u3082VCL\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u3044\u308d\u3044\u308d\u306a\u6a5f\u80fd\u3092\u7c21\u5358\u306b\u5b9f\u73fe\u51fa\u6765\u308b\u306e\u3082\u7279\u5fb4\u3067\u3059\u3002<br \/>\n\u4ed6\u306b\u3082\u3042\u307e\u308a\u30cd\u30c3\u30c8\u4e0a\u306b\u8a18\u4e8b\u304c\u306a\u3044\u305f\u3081\u77e5\u3089\u308c\u3066\u3044\u307e\u305b\u3093\u304c\u3001\u30b3\u30a2\u90e8\u5206\u3092\u53e9\u304f\u3053\u3068\u304c\u7121\u3051\u308c\u3070\u5272\u3068\u7c21\u5358\u306bVMOD\u306f\u4f5c\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<br \/>\n\u305d\u3053\u3067\u4eca\u56de\u306f\u3001\u5b9f\u969b\u306blibvmod-dump(\u4ee5\u4e0bvmod-dump)\u3068\u3044\u3046VMOD\u3092\u4f5c\u6210\u3057\u3064\u3064\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n<p>\u958b\u767a\u74b0\u5883\u306b\u3064\u3044\u3066\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<ul>\n<ol>Ubuntu 14.04.3 LTS<\/ol>\n<ol>Varnish Cache 4.1.0<\/ol>\n<\/ul>\n<h3>\u4eca\u56de\u4f5c\u308bvmod-dump\u306b\u3064\u3044\u3066<\/h3>\n<p>Varnish\u3067\u30c7\u30d0\u30c3\u30b0\u3059\u308b\u969b\u306fvarnishlog\u3084varnishncsa\u3092\u5229\u7528\u3057\u3066VSL\u306b\u51fa\u529b\u3055\u308c\u305f\u30ed\u30b0\u3092\u8ffd\u3063\u304b\u3051\u307e\u3059\u3002<br \/>\n\u4f8b\u3048\u3070\u30a8\u30e9\u30fc\u304c\u8d77\u304d\u305f\u969b\u306b\u518d\u73fe\u3055\u305b\u308b\u305f\u3081\u306brequest\u306e\u8a73\u7d30\u306a\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u305f\u3044\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u4ee5\u524d\u66f8\u3044\u305f<a href=\"http:\/\/labs.gree.jp\/blog\/2013\/12\/8979\/\">\u8a18\u4e8b<\/a>\u306b\u8cbc\u3063\u3066\u3042\u308b\u751f\u30ed\u30b0\u3092\u53c2\u7167\u3057\u3066\u3044\u305f\u3060\u304d\u305f\u3044\u306e\u3067\u3059\u304c\u3001\u30ea\u30af\u30a8\u30b9\u30c8\u30d8\u30c3\u30c0\u306f\u542b\u307e\u308c\u3066\u3044\u308b\u3051\u3069\u30dc\u30c7\u30a3\u304c\u542b\u307e\u308c\u3066\u3044\u306a\u3044\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002<br \/>\n\u305d\u3053\u3067\u4eca\u56de\u306evmod-dump\u3067\u306f\u3053\u308c\u3092dump\u51fa\u6765\u308b\u3088\u3046\u306b\u3057\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \" >\nimport dump;\n\nsub vcl_deliver {\n  if(resp.status >= 500) {\n    dump.req(\"Error request.\");\n  }\n}\n<\/pre>\n<p>\u30a4\u30e1\u30fc\u30b8\u7684\u306b\u306f\u3053\u306e\u3088\u3046\u306a\u611f\u3058\u3067\u3001VCL\u3068\u7d44\u307f\u5408\u308f\u305b\u3066\u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9\u304c500\u4ee5\u4e0a\u306e\u6642\u3060\u3051dump\u3059\u308b\u3088\u3046\u306b\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h3>\u6700\u521d\u306b\u74b0\u5883\u3092\u6e96\u5099\u3059\u308b<\/h3>\n<p>3.0.x\u306e\u3053\u308d\u306fVMOD\u306e\u958b\u767a\u74b0\u5883\u3092\u4f5c\u308b\u306e\u306f\u5272\u3068\u3081\u3093\u3069\u304f\u3055\u304b\u3063\u305f\u306e\u3067\u3059\u304c\u6700\u65b0\u306e4.1.x\u3067\u306f\u975e\u5e38\u306b\u7c21\u5358\u3067\u3059\u3002<br \/>\n\u307e\u305a\u306f\u74b0\u5883\u3092\u6574\u3048\u3064\u3064\u30d3\u30eb\u30c9\u3057\u3066\u52d5\u304f\u3068\u3053\u308d\u307e\u3067\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong>\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/strong><br \/>\nVMOD\u4f5c\u6210\u3067\u6700\u4f4e\u9650\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u306f\u4ee5\u4e0b\u306a\u306e\u3067\u3068\u308a\u3042\u3048\u305a\u5165\u308c\u307e\u3057\u3087\u3046\u3002<\/p>\n<ul>\n<ol>varnish<\/ol>\n<ol>libvarnishapi1<\/ol>\n<ol>libvarnishapi-dev<\/ol>\n<\/ul>\n<p>\u4ed6\u306b\u3082autotools(automake autoconf libtool)\u3084python-docutils\u306a\u3069\u304c\u5fc5\u8981\u3067\u3059\u304c\u958b\u767a\u3092\u884c\u3046\u30de\u30b7\u30f3\u3067\u3042\u308c\u3070\u5927\u4f53\u5165\u3063\u3066\u3044\u308b\u3068\u601d\u3044\u307e\u3059\u306e\u3067\u5272\u611b\u3057\u307e\u3059\u3002<br \/>\n\u5165\u3063\u3066\u306a\u304f\u3066\u3082\u4ee5\u964d\u306e\u624b\u9806\u4e2d\u306b\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u8db3\u308a\u306a\u3044\u3068\u3044\u3046\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u306e\u3067\u305d\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308c\u3070\u826f\u3044\u3067\u3059\u3002<\/p>\n<p><strong>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u53d6\u5f97(vmod-example)<\/strong><br \/>\nVarnish\u516c\u5f0f\u3067VMOD\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306e<a href=\"https:\/\/github.com\/varnish\/libvmod-example\">\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8<\/a>\u3092\u7528\u610f\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u307e\u305a\u306f\u3053\u3061\u3089\u3092clone\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true \" >\nxcir@varnish41-1:~\/ex$ git clone https:\/\/github.com\/varnish\/libvmod-example.git libvmod-dump\nCloning into 'libvmod-dump'...\nremote: Counting objects: 615, done.\nremote: Total 615 (delta 0), reused 0 (delta 0), pack-reused 615\nReceiving objects: 100% (615\/615), 90.33 KiB | 0 bytes\/s, done.\nResolving deltas: 100% (320\/320), done.\nChecking connectivity... done.\nxcir@varnish41-1:~\/ex$\n<\/pre>\n<p><strong>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u30ea\u30cd\u30fc\u30e0(rename-vmod-script)<\/strong><br \/>\n\u307e\u3060clone\u3057\u3066\u304d\u305f\u3060\u3051\u3067\u3001\u4e2d\u8eab\u306fvmod-example\u306a\u306e\u3067\u3001\u30ea\u30cd\u30fc\u30e0\u3057\u307e\u3059\u3002<br \/>\n\u30ea\u30cd\u30fc\u30e0\u3059\u308b\u305f\u3081\u306erename-vmod-script\u3068\u3044\u3046\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u540c\u68b1\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u305d\u308c\u3092\u5229\u7528\u3059\u308b\u3068\u4e00\u6c17\u306b\u5909\u66f4\u3067\u304d\u3066\u4fbf\u5229\u3067\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true \" >\nxcir@varnish41-1:~\/ex\/libvmod-dump$ .\/rename-vmod-script\nUsage: .\/rename-vmod-script\nRename libvmod-example source tree.\n\nxcir@varnish41-1:~\/ex\/libvmod-dump$ .\/rename-vmod-script dump\nrm 'rename-vmod-script'\nAll done.\nFor your cut&amp;paste needs:\ngit commit -a -m \"Automatic rename of libvmod-example to libvmod-dump.\"\nxcir@varnish41-1:~\/ex\/libvmod-dump$\n<\/pre>\n<p><strong>\u30d3\u30eb\u30c9\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u307f\u308b<\/strong><br \/>\n\u3068\u308a\u3042\u3048\u305a\u3053\u306e\u72b6\u614b\u306e\u307e\u307e\u3067\u30d3\u30eb\u30c9\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"lang:sh decode:true \" >\nxcir@varnish41-1:~\/ex\/libvmod-dump$ .\/autogen.sh\n+ aclocal -I m4 -I \/usr\/share\/aclocal\n...\nsrc\/Makefile.am: installing '.\/depcomp'\n+ autoconf\nxcir@varnish41-1:~\/ex\/libvmod-dump$ .\/configure\nchecking build system type... x86_64-unknown-linux-gnu\n...\nconfig.status: executing depfiles commands\nconfig.status: executing libtool commands\nxcir@varnish41-1:~\/ex\/libvmod-dump$ make\nmake  all-recursive\nmake[1]: Entering directory `\/home\/xcir\/ex\/libvmod-dump'\n...\nmake[1]: Leaving directory `\/home\/xcir\/ex\/libvmod-dump'\nxcir@varnish41-1:~\/ex\/libvmod-dump$ sudo make install\nMaking install in src\nmake[1]: Entering directory `\/home\/xcir\/ex\/libvmod-dump\/src'\n...\nmake[1]: Leaving directory `\/home\/xcir\/ex\/libvmod-dump'\nxcir@varnish41-1:~\/ex\/libvmod-dump$\n<\/pre>\n<p>\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u5834\u5408\u306f\u3060\u3044\u305f\u3044\u30d1\u30c3\u30b1\u30fc\u30b8\u4e0d\u8db3\u3060\u3068\u601d\u3044\u307e\u3059\u306e\u3067\u3001\u30a8\u30e9\u30fc\u306e\u5185\u5bb9\u306b\u305d\u3063\u3066\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u5165\u308c\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u3088\u304frst2man\u304c\u306a\u3044\u3068\u3044\u3046\u30a8\u30e9\u30fc\u304c\u3067\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u304c\u3001python-docutils\u3092\u5165\u308c\u308c\u3070\u89e3\u6c7a\u3057\u307e\u3059\u3002<\/p>\n<p><strong>Varnish\u304b\u3089\u52d5\u4f5c\u306e\u78ba\u8a8d\u3092\u3057\u3066\u307f\u308b<\/strong><br \/>\n\u4eca\u30d3\u30eb\u30c9\u3057\u305fvmod_dump(\u4e2d\u8eab\u306fexample\u3067\u3059\u304c)\u3092\u5b9f\u969b\u306bVarnish\u304b\u3089\u53e9\u3044\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br \/>\n\u307e\u305a\u306f\u3001\u4f7f\u3044\u65b9\u3092\u898b\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><a name=\"man\"><\/A><\/p>\n<pre class=\"lang:sh decode:true \" >\nxcir@varnish41-1:~\/ex\/libvmod-dump$ man vmod_dump\nVMOD_DUMP(3)                                                                                                                                                                 VMOD_DUMP(3)\n\nNAME\n       vmod_dump - Example VMOD\n\nSYNOPSIS\n       import dump [from \"path\"] ;\n\nDESCRIPTION\n       This is the embedded documentation for the dump VMOD. It should mention what the vmod is intended to do.\n\n       It can span multiple lines and is written in RST format.  You can even have links and lists in here:\n\n       o https:\/\/github.com\/varnish\/libvmod-dump\/\n\n       o https:\/\/www.varnish-cache.org\/\n\n       The init-function declared next does not have documentation.\n\nCONTENTS\n       o STRING hello(STRING)\n\n   STRING hello(STRING)\n       Prototype\n              STRING hello(STRING)\n\n       The different functions provided by the VMOD should also have their own embedded documentation. This section is for the hello() function.\n\nCOPYRIGHT\n          Copyright YOU (c) 1900.\n\n          (vmodtool requires this format.)\n<\/pre>\n<p>hello\u30d5\u30a1\u30f3\u30af\u30b7\u30e7\u30f3\u304c\u3042\u308b\u306e\u3067\u4f7f\u3063\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true \" >\nvcl 4.0;\nimport std;\nimport dump;\n...\n\nsub vcl_recv {\n  std.log(dump.hello(\"world\"));\n}\n<\/pre>\n<pre class=\"lang:sh decode:true \" >\nroot@varnish41-1:\/home\/xcir# varnishlog -ivcl_log -graw\n         5 VCL_Log        c Hello, world\n<\/pre>\n<p>\u52d5\u4f5c\u306e\u78ba\u8a8d\u304c\u3067\u304d\u307e\u3057\u305f\u3002<br \/>\n\u6b21\u306f\u5b9f\u969b\u306b\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3>\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u3044\u304f<\/h3>\n<p><strong>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u69cb\u9020\u3092\u898b\u3066\u307f\u3088\u3046<\/strong><br \/>\nVMOD\u3092\u4f5c\u308b\u4e0a\u3067\u6700\u4f4e\u9650\u5909\u66f4\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u30d5\u30a1\u30a4\u30eb\u304c\u5e7e\u3064\u304b\u3042\u308a\u307e\u3059\u3002<br \/>\n\u307e\u305a\u306f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u69cb\u9020\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"lang:sh decode:true \" >\n|-- COPYING\n|-- LICENSE\n|-- Makefile.am\n|-- README.rst\n|-- autogen.sh\n|-- configure.ac\n|-- debian\n|   |-- changelog\n|   |-- compat\n|   |-- control\n|   |-- copyright\n|   |-- dirs\n|   |-- docs\n|   `-- rules\n|-- m4\n|   `-- PLACEHOLDER\n|-- src\n|   |-- Makefile.am\n|   |-- tests\n|   |   `-- test01.vtc\n|   |-- vmod_dump.c\n|   `-- vmod_dump.vcc\n`-- vmod-dump.spec\n<\/pre>\n<p>\u3053\u306e\u4e2d\u3067\u6700\u4f4e\u9650\u5909\u66f4\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u306e\u304c<\/p>\n<ul>\n<ol>vmod_dump.vcc<\/ol>\n<ol>vmod_dump.c<\/ol>\n<\/ul>\n<p>\u3067\u3059\u3002<br \/>\nvmod_dump.c\u306f\u305d\u306e\u307e\u307e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n<p><strong>vcc\u3068c\u3092\u898b\u3066\u307f\u3088\u3046<\/strong><\/p>\n<p>\u3068\u308a\u3042\u3048\u305avmod_dump.vcc\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"lang:default decode:true \" >\n#\n# Copyright YOU (c) 1900.\n#\n# (vmodtool requires this format.)\n#\n\n$Module dump 3 Example VMOD\n\nDESCRIPTION\n===========\n\nThis is the embedded documentation for the dump VMOD. It should\nmention what the vmod is intended to do.\n\nIt can span multiple lines and is written in RST format.\nYou can even have links and lists in here:\n\n* https:\/\/github.com\/varnish\/libvmod-dump\/\n* https:\/\/www.varnish-cache.org\/\n\nThe init-function declared next does not have documentation.\n\n$Event init_function\n$Function STRING hello(STRING)\n\nThe different functions provided by the VMOD should also have their own\nembedded documentation. This section is for the hello() function.\n<\/pre>\n<p>\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u306fVCL\u304b\u3089\u547c\u3073\u51fa\u3059\u305f\u3081\u306e\u5b9a\u7fa9\u3084\u5148\u307b\u3069man\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002(<a href=\"#man\">\u5148\u8ff0<\/a>)<br \/>\nPrefix\u306b\u300c$\u300d\u304c\u3064\u3044\u3066\u3044\u308b\u3082\u306e\u304c\u5b9f\u969b\u306b\u30b3\u30fc\u30c9\u306b\u5f71\u97ff\u3059\u308b\u3082\u306e\u3067\u3001\u305d\u308c\u4ee5\u5916\u306f\u30b3\u30e1\u30f3\u30c8\u3084man\u3067\u4f7f\u308f\u308c\u308b\u90e8\u5206\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u3067\u306f$\u3060\u3051\u3092\u629c\u304d\u51fa\u3059\u3068<\/p>\n<pre class=\"lang:default decode:true \" >\n$Module dump 3 Example VMOD\n$Event init_function\n$Function STRING hello(STRING)\n<\/pre>\n<p>\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u305d\u308c\u305e\u308c\u8aac\u660e\u3057\u307e\u3059\u3002<br \/>\n<strong>$Module [module\u540d ] [\u30bb\u30af\u30b7\u30e7\u30f3\u756a\u53f7 ] [\u7c21\u5358\u306a\u8aac\u660e(optional) ]<\/strong><br \/>\n\u30e2\u30b8\u30e5\u30fc\u30eb\u540d\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\nVCL\u304b\u3089import\u3092\u884c\u3046\u969b\u306f\u3053\u3053\u306e\u540d\u524d\u304c\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><strong>$Event [ Event\u3092\u51e6\u7406\u3059\u308bFunction ]<\/strong><br \/>\n\u4f8b\u3048\u3070\u8aad\u307f\u8fbc\u307e\u308c\u305f\u3068\u304b\u7834\u68c4\u3055\u308c\u305f\u3068\u304bVMOD\u306e\u30e9\u30a4\u30d5\u30b5\u30a4\u30af\u30eb\u306b\u306f\u3044\u304f\u3064\u304b\u306e\u30a4\u30d9\u30f3\u30c8\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<table>\n<tr>\n<th>\u30a4\u30d9\u30f3\u30c8\u540d<\/th>\n<th>\u8aac\u660e<\/th>\n<\/tr>\n<tr>\n<td>VCL_EVENT_LOAD<\/td>\n<td>VCL\u304c\u8aad\u8fbc\u3055\u308c\u305f\u3002\u4f55\u304b\u3057\u3089\u306e\u521d\u671f\u5316\u51e6\u7406\u3092\u3057\u305f\u3044\u6642\u306a\u3069\u306b\u5229\u7528<\/td>\n<\/tr>\n<tr>\n<td>VCL_EVENT_DISCARD<\/td>\n<td>VCL\u304c\u7834\u68c4\u3055\u308c\u305f\u3002\u4e0d\u8981\u306a\u30ea\u30bd\u30fc\u30b9\u306e\u958b\u653e\u306a\u3069\u3092\u884c\u3046<\/td>\n<\/tr>\n<tr>\n<td>VCL_EVENT_WARM<\/td>\n<td>VCL\u304cWarm\u72b6\u614b\u306b\u306a\u3063\u305f\u3002\u306a\u3093\u3089\u304b\u306e\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u306e\u51e6\u7406\u3092\u884c\u3046\u5834\u5408\u306fVCL_EVENT_COLD\u3068\u5408\u308f\u305b\u3066\u610f\u8b58\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td>VCL_EVENT_COLD<\/td>\n<td>VCL\u304cCold\u72b6\u614b\u306b\u306a\u3063\u305f\u3002<\/td>\n<\/tr>\n<tr>\n<td>VCL_EVENT_USE<\/td>\n<td>VCL\u304c\u4f7f\u7528\u958b\u59cb\u3055\u308c\u305f\uff08\u5ec3\u6b62\u4e88\u5b9a\uff09<\/td>\n<\/tr>\n<\/table>\n<p>\u30d5\u30a1\u30f3\u30af\u30b7\u30e7\u30f3\u3092\u547c\u3070\u308c\u305f\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u3059\u3050\u8fd4\u305b\u308b\u3082\u306e\u3067\u3042\u308c\u3070\u3042\u307e\u308a\u3053\u306e\u8fba\u3092\u610f\u8b58\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u305b\u3093\u304c\u3001<br \/>\n\u4f8b\u3048\u3070\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u3067\u5b9a\u671f\u7684\u306b\u5916\u90e8\u304b\u3089\u60c5\u5831\u3092\u53d6\u5f97\u3057\u3066\u304d\u3066\u305d\u308c\u3067\u52d5\u304d\u3092\u5909\u3048\u308bVMOD\u306e\u5834\u5408\u3067\u3042\u308c\u3070WARM\/COLD\u3092\u610f\u8b58\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3067\u3057\u3087\u3046\u3002<br \/>\n\u3061\u306a\u307f\u306bWARM\/COLD\u306f4.1\u304b\u3089\u8ffd\u52a0\u3055\u308c\u305f\u6a5f\u80fd\u3067\u3059\u3002(<a href=\"http:\/\/blog.xcir.net\/?tag=varnish4-1-0\">\u53c2\u8003<\/a>)<\/p>\n<pre class=\"lang:c decode:true \" >\nint\ninit_function(const struct vrt_ctx *ctx, struct vmod_priv *priv,\n    enum vcl_event_e e)\n{\n    if (e != VCL_EVENT_LOAD)\n        return (0);\n\n    \/* init what you need *\/\n    return (0);\n}\n<\/pre>\n<p>\u898b\u3066\u5206\u304b\u308b\u3088\u3046\u306b\u5909\u6570e\u306b\u30a4\u30d9\u30f3\u30c8\u306e\u7a2e\u985e\u304c\u5165\u3063\u3066\u3044\u308b\u306e\u3067\u305d\u308c\u3067\u51e6\u7406\u3059\u308b\u5f62\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\npriv\u306f\u5f8c\u3067\u3082\u51fa\u3066\u304d\u307e\u3059\u304c\u3001\u4ed6\u306eFunction\u3067\u3082\u5229\u7528\u3067\u304d\u308b\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570(PRIV_VCL)\u307f\u305f\u3044\u306a\u3082\u306e\u3067\u3059\u3002<br \/>\n\u3061\u306a\u307f\u306b\u3053\u306e$Event\u5b9a\u7fa9\u81ea\u4f53\u304c\u7701\u7565\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p><strong>$Function [ \u623b\u308a\u5024\u306e\u578b ] [ Function\u540d ]([ \u5f15\u6570(optional) ],...)<\/strong><br \/>\nFunction\u306e\u5b9a\u7fa9\u3067\u3059\u3002<br \/>\n$Function STRING hello(STRING)<br \/>\n\u306b\u5bfe\u5fdc\u3059\u308b\u30d5\u30a1\u30f3\u30af\u30b7\u30e7\u30f3\u306f\u4ee5\u4e0b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:c decode:true \" >\nVCL_STRING\nvmod_hello(VRT_CTX, VCL_STRING name)\n{\n    char *p;\n    unsigned u, v;\n\n    u = WS_Reserve(ctx->ws, 0); \/* Reserve some work space *\/\n    p = ctx->ws->f;     \/* Front of workspace area *\/\n    v = snprintf(p, u, \"Hello, %s\", name);\n    v++;\n    if (v > u) {\n        \/* No space, reset and leave *\/\n        WS_Release(ctx->ws, 0);\n        return (NULL);\n    }\n    \/* Update work space with what we've used *\/\n    WS_Release(ctx->ws, v);\n    return (p);\n}\n<\/pre>\n<p>vcc\u3067\u5b9a\u7fa9\u3057\u305f\u30d5\u30a1\u30f3\u30af\u30b7\u30e7\u30f3\u540d\u306eprefix\u306bvmod_\u304c\u4ed8\u304f\u5f62\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u307e\u305f\u578b\u3067\u3059\u304c\u4ee5\u4e0b\u306e\u7a2e\u985e\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<table>\n<tr>\n<th>vcc\u3067\u306e\u578b<\/th>\n<th>\u30b3\u30fc\u30c9\u4e2d\u3067\u306e\u578b<\/th>\n<th>\u30aa\u30ea\u30b8\u30ca\u30eb\u306e\u5b9a\u7fa9<\/th>\n<th>\u8aac\u660e<\/th>\n<\/tr>\n<tr>\n<td>BACKEND<\/td>\n<td>VCL_BACKEND<\/td>\n<td>const struct director *<\/td>\n<td>\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u5b9a\u7fa9<\/td>\n<\/tr>\n<tr>\n<td>BLOB<\/td>\n<td>VCL_BLOB<\/td>\n<td>const struct vmod_priv *<\/td>\n<td>VMOD\u9593\u3067\u30c7\u30fc\u30bf\u306e\u3084\u308a\u53d6\u308a\u3092\u3059\u308b\u3068\u304d\u306b\u4f7f\u7528<\/td>\n<\/tr>\n<tr>\n<td>BOOL<\/td>\n<td>VCL_BOOL<\/td>\n<td>unsigned<\/td>\n<td>BOOL<\/td>\n<\/tr>\n<tr>\n<td>BYTES<\/td>\n<td>VCL_BYTES<\/td>\n<td>double<\/td>\n<td>\u30d5\u30a1\u30a4\u30eb\u30b5\u30a4\u30ba\u3092\u6307\u5b9a\u3001VCL\u4e2d\u3067\u306f\u5358\u4f4d\u3067B,KB,MB,GB,TB\u304c\u6307\u5b9a\u53ef\u80fd<\/td>\n<\/tr>\n<tr>\n<td>DURATION<\/td>\n<td>VCL_DURATION<\/td>\n<td>double<\/td>\n<td>\u6642\u9593\u3092\u6307\u5b9a\u3001VCL\u4e2d\u3067\u306f\u5358\u4f4d\u3067ms,s,m,h,d,w,y\u304c\u6307\u5b9a\u53ef\u80fd<\/td>\n<\/tr>\n<tr>\n<td>ENUM<\/td>\n<td>VCL_ENUM<\/td>\n<td>const char *<\/td>\n<td>\u5217\u6319\u578b\u3001\u5b9a\u7fa9\u3067\u306fENUM { foo, bar }\u306e\u3088\u3046\u306b\u6307\u5b9a\u3059\u308b<\/td>\n<\/tr>\n<tr>\n<td>HEADER<\/td>\n<td>VCL_HEADER<\/td>\n<td>const struct gethdr_s *<\/td>\n<td>\u30d8\u30c3\u30c0\u30fc\u3001req.http.cookie\u306e\u3088\u3046\u306b\u6307\u5b9a\u3059\u308b<\/td>\n<\/tr>\n<tr>\n<td>HTTP<\/td>\n<td>VCL_HTTP<\/td>\n<td>struct http *<\/td>\n<td>HTTP\u30d8\u30c3\u30c0\u5168\u4f53\u3092\u8868\u3059\u3001req\u306e\u3088\u3046\u306b\u6307\u5b9a<\/td>\n<\/tr>\n<tr>\n<td>INT<\/td>\n<td>VCL_INT<\/td>\n<td>long<\/td>\n<td>\u6574\u6570<\/td>\n<\/tr>\n<tr>\n<td>IP<\/td>\n<td>VCL_IP<\/td>\n<td>const struct suckaddr *<\/td>\n<td>IP\u30a2\u30c9\u30ec\u30b9<\/td>\n<\/tr>\n<tr>\n<td>PRIV_CALL<\/td>\n<td>struct vmod_priv *<\/td>\n<td>\u2190<\/td>\n<td>\u547c\u3073\u51fa\u3057\u6bce\u306b\u6709\u52b9\u306a\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u30dd\u30a4\u30f3\u30bf\u3001\u540c\u4e00Function\u3067\u3082\u7570\u306a\u308b\u547c\u3073\u51fa\u3057\u3067\u306f\u30dd\u30a4\u30f3\u30bf\u306f\u5171\u6709\u3055\u308c\u307e\u305b\u3093\u3001\u3053\u306e\u578b\u306fVCL\u4e2d\u304b\u3089\u6307\u5b9a\u3067\u304d\u307e\u305b\u3093\u3002<\/td>\n<\/tr>\n<tr>\n<td>PRIV_VCL<\/td>\n<td>struct vmod_priv *<\/td>\n<td>\u2190<\/td>\n<td>VCL\u4e2d\u3067\u6709\u52b9\u306a\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u30dd\u30a4\u30f3\u30bf\u3001\u3053\u306e\u578b\u306fVCL\u4e2d\u304b\u3089\u6307\u5b9a\u3067\u304d\u307e\u305b\u3093\u3002<\/td>\n<\/tr>\n<tr>\n<td>PRIV_TASK<\/td>\n<td>struct vmod_priv *<\/td>\n<td>\u2190<\/td>\n<td>\u30bf\u30b9\u30af\u6bce(client\/backend)\u306b\u6709\u52b9\u306a\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u30dd\u30a4\u30f3\u30bf\u3001\u3053\u306e\u578b\u306fVCL\u4e2d\u304b\u3089\u6307\u5b9a\u3067\u304d\u307e\u305b\u3093\u3002<\/td>\n<\/tr>\n<tr>\n<td>PRIV_TOP<\/td>\n<td>struct vmod_priv *<\/td>\n<td>\u2190<\/td>\n<td>\u30ea\u30af\u30a8\u30b9\u30c8(ESI\u306e\u30b5\u30d6\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u542b\u3080)\u5168\u4f53\u3067\u6709\u52b9\u306a\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u30dd\u30a4\u30f3\u30bf\u3001\u3053\u306e\u30dd\u30a4\u30f3\u30bf\u306fclient\u5074\u3067\u306e\u307f\u6709\u52b9\u3067\u3059\u3001\u3053\u306e\u578b\u306fVCL\u4e2d\u304b\u3089\u6307\u5b9a\u3067\u304d\u307e\u305b\u3093\u3002<\/td>\n<\/tr>\n<tr>\n<td>REAL<\/td>\n<td>VCL_REAL<\/td>\n<td>double<\/td>\n<td>\u6d6e\u52d5\u5c0f\u6570\u70b9<\/td>\n<\/tr>\n<tr>\n<td>STRING<\/td>\n<td>VCL_STRING<\/td>\n<td>const char *<\/td>\n<td>\u6587\u5b57\u5217\u578b<\/td>\n<\/tr>\n<tr>\n<td>STRING_LIST<\/td>\n<td>const char *, ...<\/td>\n<td>\u2190<\/td>\n<td>\u6587\u5b57\u5217\u578b\uff08\u30ea\u30b9\u30c8\uff09<\/td>\n<\/tr>\n<tr>\n<td>TIME<\/td>\n<td>VCL_TIME<\/td>\n<td>double<\/td>\n<td>\u6642\u523b<\/td>\n<\/tr>\n<tr>\n<td>PROBE<\/td>\n<td>VCL_PROBE<\/td>\n<td>const struct vrt_backend_probe *<\/td>\n<td>\u30d8\u30eb\u30b9\u30c1\u30a7\u30c3\u30af\u306e\u5b9a\u7fa9(probe)<\/td>\n<\/tr>\n<tr>\n<td>VOID<\/td>\n<td>VCL_VOID<\/td>\n<td>void<\/td>\n<td>VOID<\/td>\n<\/tr>\n<\/table>\n<p>\u4eca\u56de\u306f\u5165\u9580\u7de8\u3068\u3044\u3046\u3053\u3068\u3082\u3042\u308b\u306e\u3067\u5168\u3066\u306e\u7d30\u304b\u3044\u4f7f\u3044\u65b9\u306f\u8aac\u660e\u3057\u307e\u305b\u3093\u304c<br \/>\nPRIV_\u306f\u4f7f\u3044\u65b9\u304c\u7279\u6b8a\u306a\u306e\u3068\u30b9\u30b3\u30fc\u30d7\u304c\u5272\u3068\u96e3\u3057\u3044\u306e\u3067\u56f3\u89e3\u3057\u307e\u3059\u3002<br \/>\nPRIV_\u306fvcc\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u66f8\u3044\u3066\u3082<\/p>\n<pre class=\"lang:default decode:true \" title=\"vcc\" >\n$Function VOID example(PRIV_TOP)\n<\/pre>\n<p>VCL\u304b\u3089\u547c\u3073\u51fa\u3059\u5834\u5408\u306f<\/p>\n<pre class=\"lang:default decode:true \" title=\"vcl\" >\nexample.example();\n<\/pre>\n<p>\u3068\u306a\u308a\u3001\u6307\u5b9a\u3067\u304d\u307e\u305b\u3093\u3002VMOD\u3067\u306e\u307f\u4f7f\u7528\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p><strong>PRIV_VCL<\/strong><br \/>\n<a href=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/pvcl.png\" rel=\"attachment wp-att-15460\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/pvcl-294x400.png\" alt=\"pvcl\" width=\"294\" height=\"400\" class=\"alignnone size-medium wp-image-15460\" srcset=\"https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/pvcl-294x400.png 294w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/pvcl-147x200.png 147w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/pvcl.png 541w\" sizes=\"auto, (max-width: 294px) 100vw, 294px\" \/><\/a><br \/>\nVCL\u6bce\u306b\u4fdd\u6301\u3059\u308b\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u306e\u30dd\u30a4\u30f3\u30bf(\u4ee5\u4e0bpriv)\u3067\u3059\u3002<br \/>\n\u540c\u4e00VMOD\u306eFunction\u306a\u3069\u304b\u3089\u540c\u3058\u30dd\u30a4\u30f3\u30bf\u304c\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<br \/>\nEvent\u3067\u6e21\u3055\u308c\u308bpriv\u306f\u3053\u308c\u3067\u3059\u3002<br \/>\n\u307e\u305f\u3001VCL\u6bce\u306a\u306e\u3067\u4f8b\u3048\u3070VCL\u3092reload\u3059\u308b\u306a\u3069\u3057\u305f\u5834\u5408\u306f\u5f53\u7136\u306a\u304c\u3089\u5225\u306epriv\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u4f8b\u3048\u3070\u3001\u305d\u306eVMOD\u5168\u4f53\u3067\u4f7f\u3046\u6b63\u898f\u8868\u73fe\u306e\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u305f\u7d50\u679c\u306e\u30b9\u30c8\u30a2\u306a\u3069\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p><strong>PRIV_CALL<\/strong><br \/>\n<a href=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/pcall.png\" rel=\"attachment wp-att-15453\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/pcall-276x188.png\" alt=\"pcall\" width=\"276\" height=\"188\" class=\"alignnone size-thumbnail wp-image-15453\" srcset=\"https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/pcall-276x188.png 276w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/pcall.png 527w\" sizes=\"auto, (max-width: 276px) 100vw, 276px\" \/><\/a><br \/>\n\u547c\u3073\u51fa\u3057\u6bce\u306b\u4fdd\u6301\u3059\u308bpriv\u3067\u3059\u3002<br \/>\n\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u91cd\u306d\u3066\u3082\u540c\u3058\u547c\u3073\u51fa\u3057\u3067\u306f\u540c\u3058priv\u304c\u8fd4\u3055\u308c\u307e\u3059\u3002<br \/>\n\u305f\u3060\u3057\u3001\u540c\u3058\u30d5\u30a1\u30f3\u30af\u30b7\u30e7\u30f3\u3067\u3082\u547c\u3073\u51fa\u3057\u4f4d\u7f6e\u304c\u9055\u3046\u5834\u5408\u306f\u5225priv\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u4f8b\u3048\u3070\u3001\u305d\u306e\u547c\u3073\u51fa\u3057\u6bce\u306b\u30b3\u30b9\u30c8\u304c\u304b\u304b\u308b\u521d\u671f\u5316\u304c\u5fc5\u8981\u306a\u5834\u5408\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p><strong>PRIV_TASK<\/strong><br \/>\n<a href=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/ptask.png\" rel=\"attachment wp-att-15454\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/ptask-276x184.png\" alt=\"ptask\" width=\"276\" height=\"184\" class=\"alignnone size-thumbnail wp-image-15454\" srcset=\"https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/ptask-276x184.png 276w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/ptask.png 534w\" sizes=\"auto, (max-width: 276px) 100vw, 276px\" \/><\/a><br \/>\nvxid\u6bce\u306b\u4fdd\u6301\u3059\u308bpriv\u3067\u3059\u3002<br \/>\n\u30ea\u30af\u30a8\u30b9\u30c8\u6bce\u306b\u4f5c\u6210\u3055\u308c\u3001\u30ea\u30af\u30a8\u30b9\u30c8\u9593\u3067\u306f\u5171\u6709\u3055\u308c\u307e\u305b\u3093\u3002<br \/>\n\u4f8b\u3048\u3070\u3001\u30af\u30c3\u30ad\u30fc\u3084POST\u306e\u30d1\u30fc\u30b9\u7d50\u679c\u306a\u3069\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p><strong>PRIV_TOP<\/strong><br \/>\n<a href=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/ptop.png\" rel=\"attachment wp-att-15464\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/ptop-276x187.png\" alt=\"ptop\" width=\"276\" height=\"187\" class=\"alignnone size-thumbnail wp-image-15464\" srcset=\"https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/ptop-276x187.png 276w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/ptop.png 534w\" sizes=\"auto, (max-width: 276px) 100vw, 276px\" \/><\/a><br \/>\nreq_top.*\u5909\u6570\u3068\u540c\u3058\u30b9\u30b3\u30fc\u30d7\u3067\u4fdd\u6301\u3059\u308bpriv\u3067\u3059\u3002<br \/>\n\u89aa\u5b50\u95a2\u4fc2\u3092\u542b\u3080\u30ea\u30af\u30a8\u30b9\u30c8\u6bce\u3067\u4f5c\u6210\u3055\u308c\u3001\u95a2\u9023\u3057\u306a\u3044\u30ea\u30af\u30a8\u30b9\u30c8\u3067\u306f\u5171\u6709\u3055\u308c\u307e\u305b\u3093\u3002<br \/>\n\u307e\u305f\u3001backendthread(vcl_backend_response\u306a\u3069)\u3067\u306f\u5229\u7528\u3067\u304d\u307e\u305b\u3093\u3002<br \/>\n\u4f8b\u3048\u3070\u3001\u89aa\u5b50\u9593\u3067\u30c7\u30fc\u30bf\u306e\u3084\u308a\u53d6\u308a\u3059\u308b\u5834\u5408\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>\u30d5\u30a1\u30f3\u30af\u30b7\u30e7\u30f3\u306e\u5b9a\u7fa9\u306f\u3053\u308c\u3089\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u884c\u3044\u307e\u3059\u3002<br \/>\n\u307e\u305f\u3001\u5909\u308f\u3063\u305f\u4f7f\u3044\u65b9\u3068\u3057\u3066\u3067\u3059\u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u3092\u6307\u5b9a\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \" >$Function foo(STRING a=\"hoge\", INT b=0)<\/pre>\n<p>\u306e\u3088\u3046\u306a\u6307\u5b9a\u3092\u3059\u308b\u3053\u3068\u3067VCL\u304b\u3089\u5f15\u6570\u3092\u7701\u7565\u3057\u305f\u308a\u4e00\u90e8\u306e\u6307\u5b9a\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \" >\n\/\/b\u306e\u307f\u6307\u5b9a\u3059\u308b\nexample.foo(b=123);\n<\/pre>\n<p><strong>\u305d\u306e\u4ed6<\/strong><br \/>\n$Object\u3068$Method\u3068\u3044\u3046\u3082\u306e\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u3053\u308c\u306fvmod-directors\u306e\u3088\u3046\u306b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u3066\u52d5\u304f\u3082\u306e\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002<br \/>\n\u4eca\u56de\u306f\u8a73\u3057\u304f\u89e3\u8aac\u3057\u307e\u305b\u3093\u3002<\/p>\n<p><strong>vmod-dump\u306e\u30b3\u30fc\u30c9\u3092\u66f8\u304f<\/strong><br \/>\n\u4eca\u56de\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u30dc\u30c7\u30a3\u3092\u53d6\u5f97\u3059\u308b\u306b\u306f\u3001\u4ee5\u524d<a href=\"http:\/\/labs.gree.jp\/blog\/2014\/12\/10734\/#body\">\u8a18\u4e8b<\/a>\u3067\u7d39\u4ecb\u3057\u305f\u65b9\u6cd5(VRB)\u3092\u4f7f\u3044\u307e\u3059\u3002<br \/>\n\u554f\u984c\u306f\u305d\u308c\u3092\u3069\u3046\u3084\u3063\u3066\u51fa\u529b\u3059\u308b\u304b\u3067\u3059\u3002<br \/>\n\u4f8b\u3048\u3070\u76f4\u63a5\u30d5\u30a1\u30a4\u30eb\u306b\u51fa\u529b\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u304c\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u89b3\u70b9\u304b\u3089\u30aa\u30b9\u30b9\u30e1\u3067\u304d\u307e\u305b\u3093\u3002<br \/>\nVMOD\u306fVCL\u304b\u3089\u547c\u3073\u51fa\u3055\u308c\u307e\u3059\u304c\u3001VCL\u306b\u5b58\u5728\u3059\u308bvcl_recv\u306a\u3069\u306e\u5404\u30a2\u30af\u30b7\u30e7\u30f3\u306e\u4e2d\u306b\u306f\u30ec\u30b9\u30dd\u30f3\u30b9\u304c\u7d42\u308f\u3063\u305f\u5f8c\u306b\u5b9f\u65bd\u3059\u308b\u3082\u306e\u304c\u3042\u308a\u307e\u305b\u3093\u3002<br \/>\n\u3064\u307e\u308a\u305d\u3053\u306b\u30d5\u30a1\u30a4\u30eb\u64cd\u4f5c\u3092\u884c\u3063\u3066\u3057\u307e\u3046\u3068\u305d\u306e\u5206\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u304c\u60aa\u5316\u3057\u307e\u3059\u3002<br \/>\n\u305d\u3053\u3067\u4eca\u56de\u306fVSL\u306b\u51fa\u529b\u3057\u305f\u4e0a\u3067\u5225\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<br \/>\n<a href=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/dump.png\" rel=\"attachment wp-att-15345\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/dump-276x104.png\" alt=\"dump\" width=\"276\" height=\"104\" class=\"alignnone size-thumbnail wp-image-15345\" srcset=\"https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/dump-276x104.png 276w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/dump-600x226.png 600w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/dump-768x289.png 768w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/dump.png 803w\" sizes=\"auto, (max-width: 276px) 100vw, 276px\" \/><\/a><br \/>\n\u3053\u306e\u3088\u3046\u306a\u30a4\u30e1\u30fc\u30b8\u3067\u3064\u304f\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u3001vcc\u3092\u5909\u66f4\u3057\u307e\u3059\u3002<br \/>\n<strong>(\u306a\u304a\u3001\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u306fvmod-dump\u306e\u958b\u767a\u9014\u4e2d\u306e\u30b3\u30fc\u30c9\u306e\u305f\u3081\u30d0\u30b0\u304c\u3042\u3063\u305f\u308a\u3057\u307e\u3059\u3001\u6700\u65b0\u7248\u306f<a href=\"https:\/\/github.com\/xcir\/libvmod-dump\">\u3053\u3061\u3089<\/a>\u3092\u53c2\u7167\u304f\u3060\u3055\u3044\u3002)<\/strong><\/p>\n<pre class=\"lang:default decode:true \" title=\"vmod_dump.vcc\" >#\n# Copyright YOU (c) 1900.\n#\n# (vmodtool requires this format.)\n#\n\n$Module dump 3 Example VMOD\n\nDESCRIPTION\n===========\n\nThis is the embedded documentation for the dump VMOD. It should\nmention what the vmod is intended to do.\n\nIt can span multiple lines and is written in RST format.\nYou can even have links and lists in here:\n\n* https:\/\/github.com\/varnish\/libvmod-dump\/\n* https:\/\/www.varnish-cache.org\/\n\nThe init-function declared next does not have documentation.\n\n$Event init_function\n$Function VOID req(STRING val=\"\")\n\nThe different functions provided by the VMOD should also have their own\nembedded documentation. This section is for the hello() function.\n<\/pre>\n<p>\u305d\u3057\u3066\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n<pre class=\"lang:c decode:true \" title=\"vmod_dump.c\" >\n#include <stdio.h>\n#include <stdlib.h>\n\n#include \"vcl.h\"\n#include \"vrt.h\"\n#include \"cache\/cache.h\"\n\n#include \"vcc_if.h\"\n\n#define VMOD_DUMP_KEY      \"VMOD-DUMP: \"\n#define VMOD_DUMP_KEY_LEN  11\n\nint\ninit_function(const struct vrt_ctx *ctx, struct vmod_priv *priv,\n    enum vcl_event_e e)\n{\n    if (e != VCL_EVENT_LOAD)\n        return (0);\n\n    \/* init what you need *\/\n    return (0);\n}\n\nvoid dump_VSL_split(struct req *req, char *p, unsigned mlen, const void *ptr, size_t l, unsigned br){\n    \n    char *p2       = p + VMOD_DUMP_KEY_LEN;\n    unsigned mlen2 = mlen - VMOD_DUMP_KEY_LEN;\n    size_t length  = l;\n    void *c_ptr    = (void*)ptr;\n    txt t;\n    t.b = p;\n    \n    do{\n        if(mlen2 > length){\n            memcpy(p2, c_ptr, length);\n            t.e = t.b + length + VMOD_DUMP_KEY_LEN;\n            if(br) {\n                memcpy(p2 + length, \"\\r\\n\", 2);\n                t.e += 2;\n            }\n            VSLbt(req->vsl, SLT_Debug,t);\n            break;\n        }\n        memcpy(p2, c_ptr, mlen2);\n        t.e = t.b + mlen2 + VMOD_DUMP_KEY_LEN;\n        if(br) {\n            memcpy(p2 + mlen2, \"\\r\\n\", 2);\n            t.e += 2;\n        }\n        VSLbt(req->vsl, SLT_Debug,t);\n        c_ptr  += mlen2;\n        length -= mlen2;\n        \n    }while(1);\n}\n\nstatic int __match_proto__(req_body_iter_f)\nvbf_printRequestBody(struct req *req, void *priv, void *ptr, size_t l)\n{\n    CHECK_OBJ_NOTNULL(req, REQ_MAGIC);\n    unsigned mlen;\n    unsigned u;\n    char *p;\n    \n    \/\/get vsl max size per line.\n    mlen = cache_param->vsl_reclen - 3;\n    \n    \/\/reserve work-space\n    u = WS_Reserve(req->ws, 0);\n    if(u < mlen) {\n        \/\/no space.\n        WS_Release(req->ws, 0);\n        return (0);\n    }\n    p = req->ws->f;\n    \n    \/\/add prefix\n    strcpy(p, VMOD_DUMP_KEY);\n\n    \/\/val\n    dump_VSL_split(req, p, mlen, priv, strlen(priv), 0);\n    \n    \/\/request header\n    for(int i=0; i < req->http0->nhd; ++i) {\n        if (req->http0->hd[i].b == NULL && req->http0->hd[i].e == NULL) continue;\n        dump_VSL_split(req, p, mlen, req->http0->hd[i].b, (req->http0->hd[i].e - req->http0->hd[i].b), 1);\n    }\n    dump_VSL_split(req,p,mlen,\"\\r\\n\",2,0);\n    \n    \/\/request body\n    if (l > 0){\n        dump_VSL_split(req, p,  mlen, ptr, l, 0);\n    }\n    \/\/free work-space\n    WS_Release(req->ws, 0);\n    return (0);\n}\n\nVCL_VOID\nvmod_req(VRT_CTX, VCL_STRING val)\n{\n    VRB_Iterate(ctx->req, vbf_printRequestBody, (void*)val);\n}\n<\/pre>\n<p>\u57fa\u672c\u7684\u306b\u306f\u4ee5\u524d\u306e<a href=\"http:\/\/labs.gree.jp\/blog\/2014\/12\/10734\/#body\">\u8a18\u4e8b<\/a>\u3068\u540c\u7b49\u306a\u306e\u3067\u3059\u304c\u3001\u5e7e\u3064\u304b\u306e\u8981\u7d20\u3092\u52a0\u3048\u3066\u307e\u3059\u306e\u3067\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n<p><strong>VRT_CTX(ctx)<\/strong><br \/>\nvrt_ctx\u306b\u306f\u30ea\u30af\u30a8\u30b9\u30c8\u30fb\u30ec\u30b9\u30dd\u30f3\u30b9\u30d8\u30c3\u30c0\u306e\u5185\u5bb9\u3084VCL\u3001workspace\u306a\u3069\u306e\u60c5\u5831\u304c\u5165\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\nVarnish\u306e\u5404\u7a2e\u60c5\u5831\u306b\u30a2\u30af\u30bb\u30b9\u3057\u305f\u3044\u5834\u5408\u306f\u3053\u3053\u3092\u8fbf\u308b\u3068\u57fa\u672c\u7684\u306b\u3059\u3079\u3066\u3042\u308a\u307e\u3059\u3002<br \/>\n\u4eca\u56de\u30ea\u30af\u30a8\u30b9\u30c8\u30d8\u30c3\u30c0\u3092\u53d6\u5f97\u3059\u308b\u969b\u306bctx->req->http0\u3092\u5229\u7528\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u306ehttp0\u306fVCL\u3067\u5909\u66f4\u3057\u305f\u5185\u5bb9\u304c\u542b\u307e\u308c\u306a\u3044\u30aa\u30ea\u30b8\u30ca\u30eb\u306e\u30d8\u30c3\u30c0\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u307e\u305f\u3001\u5fc5\u305a\u3057\u3082\u69cb\u9020\u4f53\u306b\u3042\u308b\u30c7\u30fc\u30bf\u304c\u5168\u3066\u6709\u52b9\u3068\u3044\u3046\u308f\u3051\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<br \/>\n\u308f\u304b\u308a\u6613\u3044\u4f8b\u3060\u3068backend-thread\u3067\u306fctx->req\u306b\u306f\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u305b\u3093\u3001\u5b9f\u969b\u306b\u53e9\u3044\u3066\u307f\u308b\u306e\u304c\u5206\u304b\u308a\u3084\u3059\u3044\u3067\u3059\u3002<\/p>\n<p><strong>cache_param->vsl_reclen<\/strong><br \/>\nVSL\u306e\u30e9\u30a4\u30f3\u3042\u305f\u308a\u306b\u51fa\u529b\u53ef\u80fd\u306a\u30b5\u30a4\u30ba\u306f\u6c7a\u307e\u3063\u3066\u304a\u308a\u3001\u305d\u308c\u3092\u8d85\u904e\u3059\u308b\u3068\u5207\u308a\u6368\u3066\u3089\u308c\u308b\u305f\u3081\u3001\u6700\u5927\u9577(vsl_reclen)\u3092\u30d1\u30e9\u30e1\u30fc\u30bf\u304b\u3089\u53d6\u5f97\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\ncache_param\u306b\u306f\u8d77\u52d5\u6642\u306b\u6307\u5b9a\u3059\u308b\u5404\u7a2e\u30d1\u30e9\u30e1\u30fc\u30bf\u304c\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u305d\u3053\u304b\u3089vsl_reclen\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<p><strong>WS_Reserve, WS_Release(\u30ef\u30fc\u30af\u30b9\u30da\u30fc\u30b9)<\/strong><br \/>\nVarnish \u3067\u306f\u3001\u30bb\u30c3\u30b7\u30e7\u30f3\u6bce\u306b\u30ef\u30fc\u30af\u30b9\u30da\u30fc\u30b9(crx->ws)\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002\u3053\u3053\u304b\u3089\u30e1\u30e2\u30ea\u3092\u78ba\u4fdd\u3059\u308c\u3070\u3001Varnish \u5074\u3067\u5236\u5fa1\u3057\u3066\u304f\u308c\u308b\u306e\u3067\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u306e\u5fc3\u914d\u304c\u306a\u304f\u4fbf\u5229\u3067\u3059\u3002<br \/>\n\u4f7f\u3044\u65b9\u306f\u305d\u3053\u307e\u3067\u96e3\u3057\u304f\u3042\u308a\u307e\u305b\u3093\u3002<br \/>\n\u57fa\u672c\u7684\u306b\u306fWS_Reserve\u3067\u4e00\u6642\u9818\u57df\u3092\u78ba\u4fdd\u3057\u3066WS_Release\u3067\u56fa\u5b9a\u5316\u3082\u3057\u304f\u306f\u958b\u653e\u3057\u307e\u3059\u3002<br \/>\nvmod-example\u306e\u30b3\u30fc\u30c9\u3068ws\u306e\u5b9a\u7fa9\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"lang:c decode:true \" title=\"vmod_example.c\u3088\u308avmod_hello\" >VCL_STRING\nvmod_hello(VRT_CTX, VCL_STRING name)\n{\n    char *p;\n    unsigned u, v;\n\n    u = WS_Reserve(ctx-&gt;ws, 0); \/* Reserve some work space *\/\n    \/\/[\u78ba\u4fdd\u51fa\u6765\u305f\u30b5\u30a4\u30ba] = WS_Reserve(ctx-&gt;ws, [\u78ba\u4fdd\u3057\u305f\u3044\u30b5\u30a4\u30ba\u3001\u57fa\u672c\u7684\u306b\u306f\u9650\u754c\u307e\u3067\u53d6\u5f97\u3059\u308b0\u3092\u6307\u5b9a\u3059\u308b]);\n    p = ctx-&gt;ws-&gt;f;       \/* Front of workspace area *\/\n    \/\/ctx->ws->f\u304c\u4f7f\u7528\u53ef\u80fd\u306a\u30dd\u30a4\u30f3\u30bf\u3092\u793a\u3057\u3066\u3044\u308b\u306e\u3067\u305d\u308c\u3092\u6307\u5b9a\n    v = snprintf(p, u, \"Hello, %s\", name);\n    v++;\n    \/\/\u30b5\u30a4\u30ba\u30c1\u30a7\u30c3\u30af\n    if (v &gt; u) {\n        \/* No space, reset and leave *\/\n        WS_Release(ctx-&gt;ws, 0);\n        \/\/WS_Release(ctx-&gt;ws, [0\u3092\u6307\u5b9a\u3059\u308b\u3068\u78ba\u4fdd\u3057\u305f\u9818\u57df\u3092\u7834\u68c4\u3059\u308b]);\n        return (NULL);\n    }\n    \/* Update work space with what we've used *\/\n    WS_Release(ctx-&gt;ws, v);\n    \/\/WS_Release(ctx-&gt;ws, [\u56fa\u5b9a\u5316\u3057\u305f\u3044\u30b5\u30a4\u30ba\u3092\u6307\u5b9a]);\n    return (p);\n}<\/pre>\n<pre class=\"lang:c decode:true \" title=\"varnishd\/cache\/cache.h\" >\n\/*--------------------------------------------------------------------\n * Workspace structure for quick memory allocation.\n *\/\n\nstruct ws {\n    unsigned        magic;\n#define WS_MAGIC       0x35fac554\n    char            id[4];      \/* identity *\/\n    char            *s;     \/* (S)tart of buffer *\/\n    char            *f;     \/* (F)ree\/front pointer *\/\n    char            *r;     \/* (R)eserved length *\/\n    char            *e;     \/* (E)nd of buffer *\/\n};\n}<\/pre>\n<p>WS_Reserve\/WS_Release(\u304a\u307e\u3051\u3067WS_Alloc\u3082)\u3092\u5229\u7528\u3057\u305f\u969b\u306b\u3069\u306e\u3088\u3046\u306b\u30ef\u30fc\u30af\u30b9\u30da\u30fc\u30b9\u306e\u72b6\u614b\u304c\u5909\u308f\u308b\u304b\u3068\u69cb\u9020\u4f53\u5185\u306es,f,r,e\u30dd\u30a4\u30f3\u30bf\u306e\u52d5\u304d\u3092\u56f3\u89e3\u3057\u307e\u3059\u3002<br \/>\n<a href=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/ws-1.png\" rel=\"attachment wp-att-15628\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/ws-1-165x200.png\" alt=\"ws\" width=\"165\" height=\"200\" class=\"alignnone size-thumbnail wp-image-15628\" srcset=\"https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/ws-1-165x200.png 165w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/ws-1-331x400.png 331w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2015\/12\/ws-1.png 669w\" sizes=\"auto, (max-width: 165px) 100vw, 165px\" \/><\/a><br \/>\n\u4e00\u6642\u9818\u57df\u306f\u3001\u4f7f\u3044\u7d42\u308f\u3063\u305f\u6642\u70b9\u3067\u5fc5\u305a\u305d\u306e\u9818\u57df\u3092\u8fd4\u5374\u3059\u308b\u304b\u304b\u56fa\u5b9a\u5316\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u4e00\u6642\u9818\u57df\u3092\u4f5c\u308c\u308b\u306e\u306f\u4e00\u3064\u307e\u3067\u306e\u305f\u3081\u3001\u3069\u3061\u3089\u3082\u305b\u305a\u306b\u518d\u5ea6\u4f7f\u7528\u958b\u59cb\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u30a8\u30e9\u30fc\u3068\u306a\u308a\u307e\u3059\u3002<br \/>\n\u307e\u305f\u3001WS_Reserve\u3067\u78ba\u4fdd\u3057\u305f\u304b\u3089\u3068\u3044\u3063\u3066\u3001\u78ba\u4fdd\u3057\u305f\u9818\u57df\u304czero-fill\u3055\u308c\u3066\u306f\u3044\u307e\u305b\u3093\u3002\u5b9f\u969b\u306b\u30e1\u30e2\u30ea\u3092\u78ba\u4fdd\u3059\u308b\u306e\u3067\u306f\u306a\u304f\u30dd\u30a4\u30f3\u30bf\u3092\u52d5\u304b\u3057\u3066\u3044\u308b\u3060\u3051\u3060\u304b\u3089\u3067\u3059\u3002<br \/>\n\u3061\u306a\u307f\u306b\u3001\u4eca\u56de\u5229\u7528\u3057\u305f\u306e\u306f\u6587\u5b57\u5217\u51e6\u7406\u3092\u884c\u3046\u305f\u3081\u306e\u4e00\u6642\u9818\u57df\u3068\u3057\u3066\u3067\u3059\u3002\u306a\u306e\u3067\u56fa\u5b9a\u306f\u884c\u3063\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n<p><strong>VSLbt<\/strong><br \/>\nVSL\u306b\u30c7\u30fc\u30bf\u3092\u66f8\u304d\u8fbc\u3080\u95a2\u6570\u3067\u3059\u3002<br \/>\n\u4ed6\u306b\u3082VSLb\u3084VSLb_tw\u306a\u3069\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u307e\u305f\u3001VSL\u306b\u66f8\u304d\u8fbc\u3080\u969b\u306b\u901a\u5e38\u306eVCL_Log\u30bf\u30b0\u3067\u306f\u306a\u304fDebug\u30bf\u30b0(SLT_Debug)\u3092\u5229\u7528\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u3053\u308c\u306f\u30ea\u30af\u30a8\u30b9\u30c8\u30dc\u30c7\u30a3\u306b\u306f\u30d0\u30a4\u30ca\u30ea\u304c\u542b\u307e\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u305f\u3081\u3001\u30c6\u30ad\u30b9\u30c8\u306e\u307f\u3057\u304b\u8a31\u5bb9\u3057\u306a\u3044VCL_Log\u304c\u4f7f\u3048\u305a\u3001\u8a31\u5bb9\u3057\u3066\u3044\u308bDebug\u30bf\u30b0\u3092\u4f7f\u7528\u3057\u305f\u305f\u3081\u3067\u3059\u3002<\/p>\n<h3>\u52d5\u4f5c\u3092\u78ba\u8a8d\u3057\u3066\u307f\u308b<\/h3>\n<p>\u30d3\u30eb\u30c9\u3057\u3066\u52d5\u4f5c\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"lang:default decode:true \" title=\"\/etc\/varnish\/default.vcl\">\nvcl 4.0;\nimport std;\nimport dump;\n\nbackend default {\n    .host = \"127.0.0.1\";\n    .port = \"8080\";\n}\n\nsub vcl_recv {\n  std.cache_req_body(1MB);\n}\nsub vcl_deliver{\n  if(resp.status >= 500){\n    dump.req(\"hogehoge\");\n  }\n}\n<\/pre>\n<p>backend\u306e\u30b5\u30fc\u30d0\u306f\u7acb\u3061\u4e0a\u3052\u306a\u304f\u3066\u5927\u4e08\u592b\u3067\u3059\u3002<br \/>\n\u4e0a\u304c\u3063\u3066\u3044\u306a\u3051\u308c\u3070503\u304c\u51fa\u308b\u304b\u3089\u3067\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true \" >xcir@varnish41-1:~\/ex\/libvmod-dump$ curl -F 'file=@README.rst' http:\/\/localhost:6081\/\n&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n  &lt;head&gt;\n    &lt;title&gt;503 Backend fetch failed&lt;\/title&gt;\n  &lt;\/head&gt;\n  &lt;body&gt;\n    &lt;h1&gt;Error 503 Backend fetch failed&lt;\/h1&gt;\n    &lt;p&gt;Backend fetch failed&lt;\/p&gt;\n    &lt;h3&gt;Guru Meditation:&lt;\/h3&gt;\n    &lt;p&gt;XID: 6&lt;\/p&gt;\n    &lt;hr&gt;\n    &lt;p&gt;Varnish cache server&lt;\/p&gt;\n  &lt;\/body&gt;\n&lt;\/html&gt;\n<\/pre>\n<pre class=\"lang:sh decode:true \" >root@varnish41-1:\/home\/xcir\/ex\/libvmod-dump# varnishlog -qdebug:VMOD-DUMP -graw\n         5 Debug          c \"VMOD-DUMP: hogehoge\"\n         5 Debug          c \"VMOD-DUMP: POST%0d%0a\"\n         5 Debug          c \"VMOD-DUMP: \/%0d%0a\"\n         5 Debug          c \"VMOD-DUMP: HTTP\/1.1%0d%0a\"\n         5 Debug          c \"VMOD-DUMP: User-Agent: curl\/7.35.0%0d%0a\"\n         5 Debug          c \"VMOD-DUMP: Host: localhost:6081%0d%0a\"\n         5 Debug          c \"VMOD-DUMP: Accept: *\/*%0d%0a\"\n         5 Debug          c \"VMOD-DUMP: Content-Length: 4897%0d%0a\"\n         5 Debug          c \"VMOD-DUMP: Content-Type: multipart\/form-data; boundary=------------------------936f45dd837943cd%0d%0a\"\n         5 Debug          c \"VMOD-DUMP: %0d%0a\"\n         5 Debug          c \"VMOD-DUMP: --------------------------936f45dd837943cd%0d%0aContent-Disposition: form-data; name=\"file\"; filename=\"README.rst\"%0d%0aContent-Type: application\/octet-stream%0d%0a%0d%0a============%0avmod_dump%0a============%0a%0a------------------------------------%0aDump the reques\"\n         5 Debug          c \"VMOD-DUMP: -----------------------------------%0a%0a:Author: Shohei Tanaka(@xcir)%0a:Date: 2015-12-11%0a:Version: develop-varnish41%0a:Support Varnish Version: 4.1.x%0a:Manual section: 3%0a%0aSYNOPSIS%0a========%0a%0aimport dump;%0a%0aDESCRIPTION%0a===========%0a%0aExample Varnish vmod\"\n         5 Debug          c \"VMOD-DUMP: o write an out-of-tree Varnish vmod.%0a%0aImplements the traditional Hello World as a vmod.%0a%0aFUNCTIONS%0a=========%0a%0areq%0a-----%0a%0aPrototype%0a        ::%0a%0a                req(STRING val)%0aReturn value%0a%09VOID%0aDescription%0a%09Write a request header-body to the V\"\n         5 Debug          c \"VMOD-DUMP: ::%0a%0a                import std;\/\/use libvmod-std%0a                import dump;%0a                %0a                sub vcl_recv {%0a                  std.cache_req_body(1MB);%0a                }%0a                sub vcl_deliver {%0a                  if(r\"\n         5 Debug          c \"VMOD-DUMP: %0a                    dump.req(\"dump error request.\");%0a                  }%0a                }%0a                %0a                \/\/Output sample.( curl -F 'file=@README.rst' http:\/\/localhost:6081\/ )%0a                \/\/# varnishlog -graw -qdebug:VMO\"\n         5 Debug          c \"VMOD-DUMP:    \/\/     32788 Debug          c \"VMOD-DUMP: dump error request.\"%0a                \/\/     32788 Debug          c \"VMOD-DUMP: POST%0d%0a\"%0a                \/\/     32788 Debug          c \"VMOD-DUMP: \/%0d%0a\"%0a                \/\/     32788 Debug      \"\n         5 Debug          c \"VMOD-DUMP: TP\/1.1%0d%0a\"%0a                \/\/     32788 Debug          c \"VMOD-DUMP: User-Agent: curl\/7.35.0%0d%0a\"%0a                \/\/     32788 Debug          c \"VMOD-DUMP: Host: localhost:6081%0d%0a\"%0a                \/\/     32788 Debug          c \"VMOD-DU\"\n         5 Debug          c \"VMOD-DUMP: a\"%0a                \/\/     32788 Debug          c \"VMOD-DUMP: Content-Length: 3200%0d%0a\"%0a                \/\/     32788 Debug          c \"VMOD-DUMP: Content-Type: multipart\/form-data; boundary=------------------------03d94756ba140cd1%0d%0a\"%0a    \"\n         5 Debug          c \"VMOD-DUMP: 2788 Debug          c \"VMOD-DUMP: %0d%0a\"%0a                \/\/     32788 Debug          c \"VMOD-DUMP: --------------------------03d94756ba140cd1%0d%0aContent-Disposition: form-data; name=\"file\"; filename=\"README.rst\"%0d%0aContent-Type: applicati\"\n         5 Debug          c \"VMOD-DUMP: a%0d%0a============%0avmod_dump%0a============%0a%0a------------------------------------%0aDump the request h\"%0a                \/\/     32788 Debug          c \"VMOD-DUMP: eader with body%0a------------------------------------%0a%0a:Author: Shohe\"\n         5 Debug          c \"VMOD-DUMP: ate: 2015-12-11%0a:Version: develop-varnish41%0a:Support Varnish Version: 4.1.x%0a:Manual section: 3%0a%0aSYNOPSIS%0a========%0a%0aimport dump;%0a%0aDESCRIPTION%0a===========%0a%0aExampl\"%0a                \/\/...%0a%0a                %0a%0aINSTALLATION%0a=\"\n         5 Debug          c \"VMOD-DUMP: rce tree is based on autotools to configure the building, and%0adoes also have the necessary bits in place to do functional unit tests%0ausing the ``varnishtest`` tool.%0a%0aBuilding requires the Varnish header files and uses pkg-config to find%0athe ne\"\n         5 Debug          c \"VMOD-DUMP: e::%0a%0a .\/autogen.sh%0a .\/configure%0a%0aIf you have installed Varnish to a non-standard directory, call%0a``autogen.sh`` and ``configure`` with ``PKG_CONFIG_PATH`` pointing to%0athe appropriate path. For dump, when varnishd configure was called%0awith ``--\"\n         5 Debug          c \"VMOD-DUMP: e%0a%0a PKG_CONFIG_PATH=${PREFIX}\/lib\/pkgconfig%0a export PKG_CONFIG_PATH%0a%0aMake targets:%0a%0a* make - builds the vmod.%0a* make install - installs your vmod.%0a* make check - runs the unit tests in ``src\/tests\/*.vtc``%0a* make distcheck - run check and prepa\"\n         5 Debug          c \"VMOD-DUMP: vmod.%0a%0aInstallation directories%0a------------------------%0a%0aBy default, the vmod ``configure`` script installs the built vmod in%0athe same directory as Varnish, determined via ``pkg-config(1)``. The%0avmod installation directory can be overridden b\"\n         5 Debug          c \"VMOD-DUMP: _DIR`` variable to ``configure``.%0a%0aOther files like man-pages and documentation are installed in the%0alocations determined by ``configure``, which inherits its default%0a``--prefix`` setting from Varnish.%0a%0aUSAGE EXAMPLE%0a=============%0a%0aIn your VCL\"\n         5 Debug          c \"VMOD-DUMP: this vmod along the following lines::%0a%0a        import dump;%0a%0a        sub vcl_deliver {%0a                # This sets resp.http.hello to \"Hello, World\"%0a                set resp.http.hello = dump.hello(\"World\");%0a        }%0a%0aCOMMON PROBLEMS%0a========\"\n         5 Debug          c \"VMOD-DUMP: : error: Need varnish.m4 -- see README.rst%0a%0a  Check if ``PKG_CONFIG_PATH`` has been set correctly before calling%0a  ``autogen.sh`` and ``configure``%0a%0a* Incompatibilities with different Varnish Cache versions%0a%0a  Make sure you build this vmod aga\"\n         5 Debug          c \"VMOD-DUMP: nt Varnish Cache version.%0a  For dump, to build against Varnish Cache 4.0, this vmod must be built from branch 4.0.%0a%0d%0a--------------------------936f45dd837943cd--%0d%0a\"\n<\/pre>\n<p>\u7121\u4e8b\u51fa\u529b\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<h3>VSL\u3092\u8aad\u3080\u30b3\u30fc\u30c9\u3092\u66f8\u304f<\/h3>\n<p>\u4ee5\u524d\u306e<a href=\"http:\/\/labs.gree.jp\/blog\/2013\/12\/8979\/\">\u8a18\u4e8b<\/a>\u3067\u89e6\u308c\u305f<a href=\"https:\/\/github.com\/xcir\/python-varnishapi\">python-varnishapi<\/a>\u3092\u4f7f\u3063\u3066\u4f5c\u308a\u307e\u3059\u3002<br \/>\nVSL\u306b\u5410\u304d\u51fa\u3057\u3066\u3044\u308b\u306e\u3067\u305d\u308c\u3092\u53d6\u5f97\u3057\u3066\u52a0\u5de5\u3059\u308b\u3060\u3051\u306a\u306e\u3067\u5272\u611b\u3057\u307e\u3059\u3002<br \/>\n\u30b3\u30fc\u30c9\u306f<a href=\"https:\/\/github.com\/xcir\/libvmod-dump\/tree\/master\/tools\">\u3053\u3061\u3089<\/a>\u306b\u3042\u308a\u307e\u3059\u3002<\/p>\n<h3>\u516c\u958b\u3057\u3066\u307f\u308b<\/h3>\n<p>\u3053\u3053\u307e\u3067\u3067\u3068\u308a\u3042\u3048\u305aVMOD\u306f\u3067\u304d\u307e\u3057\u305f\u3002<br \/>\n\u4ed6\u306b<a href=\"http:\/\/labs.gree.jp\/blog\/2013\/04\/7966\/\">\u30c6\u30b9\u30c8<\/a>(vtc)\u3092\u4f5c\u6210\u3057\u305f\u308a\u3001\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306a\u3069\u3092\u6574\u5099\u3057\u305f\u308a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u304c<br \/>\n\u305d\u308c\u304c\u7d42\u308f\u3063\u305f\u3089\u516c\u5f0f\u306e<a href=\"https:\/\/www.varnish-cache.org\/vmods\">VMOD\u30c7\u30a3\u30ec\u30af\u30c8\u30ea<\/a>\u306b\u767b\u9332\u3057\u3066\u307f\u308b\u306e\u3082\u826f\u3044\u3067\u3057\u3087\u3046\u3002<br \/>\n\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u30da\u30fc\u30b8\u306e\u4e00\u756a\u4e0b\u306bsignup\u306e\u4ed5\u65b9\u3068\u767b\u9332\u3059\u308b\u305f\u3081\u306e\u30ea\u30f3\u30af\u304c\u6709\u308a\u307e\u3059\u306e\u3067\u3001\u305d\u3053\u304b\u3089\u767b\u9332\u3057\u307e\u3057\u3087\u3046\u3002<br \/>\nVMOD\u306e\u767b\u9332\u306f\u5373\u6642\u3067\u306f\u306a\u304f\u3001\u7c21\u5358\u306a\u30ec\u30d3\u30e5\u30fc\u3092\u884c\u308f\u308c\u3066\u767b\u9332\u3055\u308c\u308b\u306e\u3067\u6570\u65e5\u307e\u3063\u3066\u7279\u306b\u554f\u984c\u306a\u3051\u308c\u3070\u30ea\u30b9\u30c8\u306b\u5165\u308a\u307e\u3059\u3002<\/p>\n<h3>vmod-dump\u81ea\u4f53\u306b\u3064\u3044\u3066<\/h3>\n<p>\u3053\u306e\u8a18\u4e8b\u3092\u66f8\u3044\u305f\u5f8c\u3082\u6a5f\u80fd\u62e1\u5f35\u3092\u3057\u3066\u307e\u3057\u3066\u3001\u30ec\u30b9\u30dd\u30f3\u30b9\u306b\u3064\u3044\u3066\u3082dump\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002(dump.resp)<br \/>\n\u307e\u305f\u3001\u540c\u68b1\u3057\u3066\u3044\u308bvarnishdump.py\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3067dump\u30d5\u30a1\u30a4\u30eb\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true \" title=\"libvmod-dump\/tools\/varnishdump.py\" >xcir@varnish41-1:~\/ex\/libvmod-dump\/tools$ sudo .\/varnishdump.py\nvxid:5 type:req time:20151216-111533 file:\/home\/xcir\/ex\/libvmod-dump\/tools\/log\/20151216-111533_5_req.dump val:hogehoge 1stline:POST \/ HTTP\/1.1\nvxid:5 type:resp time:20151216-111533 file:\/home\/xcir\/ex\/libvmod-dump\/tools\/log\/20151216-111533_5_resp.dump val:magemage 1stline:HTTP\/1.1 503 Backend fetch failed\n<\/pre>\n<p>\u30d5\u30a1\u30a4\u30eb\u306e\u4e2d\u8eab\u306f\u307e\u3093\u307eHTTP\u30ea\u30af\u30a8\u30b9\u30c8\u306a\u306e\u3067\u3082\u3061\u308d\u3093\u305d\u306e\u307e\u307enc\u30b3\u30de\u30f3\u30c9\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3067\u554f\u984c\u306e\u518d\u73fe\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<pre class=\"lang:shell decode:true \" >\nxcir@varnish41-1:~\/ex\/libvmod-dump\/tools\/log$ cat 20151215-164657_32791_req.dump | nc localhost 6081\nHTTP\/1.1 503 Backend fetch failed\nDate: Tue, 15 Dec 2015 17:14:33 GMT\n...\n<\/pre>\n<p>\u30ec\u30b9\u30dd\u30f3\u30b9\u306edump\u3082\u3042\u308b\u306e\u3067diff\u3082\u3068\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"lang:shell decode:true \" >\nxcir@varnish41-1:~\/ex\/libvmod-dump\/tools$ cat \/home\/xcir\/ex\/libvmod-dump\/tools\/log\/20151216-111533_5_req.dump | nc localhost 6081 | diff -  \/home\/xcir\/ex\/libvmod-dump\/tools\/log\/20151216-111533_5_resp.dump\n2c2\n< Date: Wed, 16 Dec 2015 02:22:56 GMT\n---\n> Date: Wed, 16 Dec 2015 02:15:33 GMT\n6c6\n< X-Varnish: 32770\n---\n> X-Varnish: 5\n9c9\n< Content-Length: 282\n---\n> Content-Length: 278\n21c21\n<     XID: 32771\n---\n>     XID: 6\n<\/pre>\n<p>(Content-Length\u306b\u9055\u3044\u304c\u51fa\u3066\u308b\u306e\u306fXID\u306e\u6841\u6570\u304c\u5909\u308f\u3063\u305f\u5206\u3067\u3059)<\/p>\n<p>\u4ed6\u306b\u3082\u4e00\u5b9a\u6642\u9593\u7d4c\u904e\u3057\u305f\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u307f\u3092dump\u51fa\u6765\u308b\u3088\u3046\u306b\u3001\u7d4c\u904e\u6642\u9593\u3092\u53d6\u5f97\u3059\u308bdump.elapsed()\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \" >\nvcl 4.0;\nimport std;\nimport dump;\n\nsub vcl_recv {\n  std.cache_req_body(1MB);\n}\nsub vcl_deliver {\n  if(dump.elapsed() > 3s){\n    \/\/\u3053\u3053\u306b\u5230\u9054\u3059\u308b\u307e\u30673\u79d2\u304b\u304b\u3063\u305f\u30ea\u30af\u30a8\u30b9\u30c8\u3068\u30ec\u30b9\u30dd\u30f3\u30b9\u3092dump\n    dump.req(\"slow request.\");\n    dump.resp(\"slow request.\");\n  }\n}\n<\/pre>\n<p>\u3055\u3089\u306b4.1.0\u3067\u65b0\u305f\u306b\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u305fPROXY\u30d7\u30ed\u30c8\u30b3\u30eb\u3092\u5229\u7528\u3059\u308b(-p\u30aa\u30d7\u30b7\u30e7\u30f3)\u3053\u3068\u3067client.ip\/server.ip\u3092\u5f53\u521d\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3068\u540c\u3058\u72b6\u614b\u3082\u518d\u73fe\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<br \/>\nACL\u8fbc\u307f\u3067\u518d\u73fe\u8a66\u9a13\u304c\u3067\u304d\u308b\u306e\u3067\u6357\u308b\u3088\u3046\u306a\u6c17\u304c\u3057\u307e\u3059\u3002<br \/>\n\u3088\u304b\u3063\u305f\u3089\u4f7f\u3063\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3>\u6700\u5f8c\u306b<\/h3>\n<p>\u4eca\u56de\u306fVMOD\u306e\u4f5c\u6210\u306e\u4ed5\u65b9\u3092\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002<br \/>\n\u3053\u306e\u3088\u3046\u306b\u3001\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u304a\u304b\u3052\u3067\u7d50\u69cb\u7c21\u5358\u306b\u4f5c\u308c\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n\u7686\u3055\u3093\u3082\u30c1\u30e3\u30ec\u30f3\u30b8\u3057\u3066\u307f\u3066\u306f\u3044\u304b\u304c\u3067\u3057\u3087\u3046\u304b\uff1f<\/p>\n<p>\u660e\u65e5\u306e\u8a18\u4e8b\u306f\u3001@hosi_mo\uff08\u8a95\u751f\u65e5\uff09\u3055\u3093\u3067\u3059\u3002\u304a\u697d\u3057\u307f\u306b\uff01<br \/>\n\u3061\u306a\u307f\u306b\u50d5\u3082\u4eca\u65e5\u304c<a href=\"https:\/\/www.amazon.co.jp\/gp\/registry\/wishlist\/AEP24O7PTXM8\/\">\u8a95\u751f\u65e5<\/a>\u3067\u3059\uff01<\/p>\n<h3>\u30ea\u30f3\u30af<\/h3>\n<p><a href=\"https:\/\/github.com\/xcir\/libvmod-dump\">libvmod-dump(\u4eca\u56de\u4f5c\u3063\u305fVMOD)<\/a><br \/>\n<a href=\"https:\/\/github.com\/xcir\/python-varnishapi\">python-varnishapi(VSL\u3092\u547c\u3073\u51fa\u3059\u306e\u306b\u4f7f\u7528\u3057\u305f\u30e9\u30a4\u30d6\u30e9\u30ea)<\/a><br \/>\n<a href=\"https:\/\/www.varnish-cache.org\/docs\/trunk\/reference\/vmod.html\">\u516c\u5f0f\u306eVMOD\u306b\u95a2\u3059\u308b\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8<\/a><br \/>\n<a href=\"https:\/\/github.com\/varnish\/Varnish-Book\/blob\/master\/varnish_book.rst#appendix-d-vmod-development\">Varnish-Book<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001Service Engineering\u30c1\u30fc\u30e0\u306e\u3044\u308f\u306a\u3061\u3083\u3093\u3055\u3093(@xcir)\u3067\u3059\u3002 \u3053\u306e\u30a8\u30f3\u30c8\u30ea\u306fGREE Advent Calendar 2015\u3068Varnish Cache Advent Calendar [&hellip;]<\/p>\n","protected":false},"author":136,"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,52],"class_list":["post-15237","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","tag-advent-calendar","tag-varnish-cache"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/posts\/15237","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\/136"}],"replies":[{"embeddable":true,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/comments?post=15237"}],"version-history":[{"count":3,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/posts\/15237\/revisions"}],"predecessor-version":[{"id":15635,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/posts\/15237\/revisions\/15635"}],"wp:attachment":[{"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/media?parent=15237"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/categories?post=15237"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/tags?post=15237"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}