{"id":2199,"date":"2015-12-05T03:55:43","date_gmt":"2015-12-04T18:55:43","guid":{"rendered":"http:\/\/blog.xcir.net\/?p=2199"},"modified":"2015-12-05T03:57:37","modified_gmt":"2015-12-04T18:57:37","slug":"vcl%e3%81%ae%e5%a4%89%e6%95%b0%e3%81%ae%e5%9e%8b%e5%a4%89%e6%8f%9b%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6vmod_std","status":"publish","type":"post","link":"https:\/\/blog.xcir.net\/?p=2199","title":{"rendered":"VCL\u306e\u5909\u6570\u306e\u578b\u5909\u63db\u306b\u3064\u3044\u3066(vmod_std)"},"content":{"rendered":"<p>\u3053\u306e\u8a18\u4e8b\u306f<a href=\"http:\/\/qiita.com\/advent-calendar\/2015\/varnish\">Varnish Cache Advent Calendar 2015<\/a>\u306e4\u65e5\u76ee\u306e\u8a18\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>VCL\u306b\u306f\u69d8\u3005\u306a\u5909\u6570\u306e\u578b\u304c\u3042\u308a\u307e\u3057\u3066\u3001\u305d\u308c\u305e\u308c\u306e\u578b\u306e\u9593\u3067\u306f\u6697\u9ed9\u7684\u306b\u5909\u63db\u3055\u308c\u308b\u3082\u306e\u3068\u3001<a href=\"https:\/\/www.varnish-cache.org\/docs\/trunk\/reference\/vmod_std.generated.html\">vmod_std<\/a>\u3092\u4f7f\u7528\u3057\u3066\u660e\u793a\u7684\u306b\u5909\u63db\u3059\u308b\u3082\u306e\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u578b\u304c\u7d50\u69cb\u591a\u3044\u306e\u3067\u3044\u307e\u3044\u3061\u4f55\u3092\u4f7f\u3046\u304b\u5fd8\u308c\u308b\u3053\u3068\u304c\u591a\u3044\u306e\u3067\u56f3\u306b\u3057\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\n<a href=\"http:\/\/blog.xcir.net\/wp-content\/uploads\/2015\/12\/types.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.xcir.net\/wp-content\/uploads\/2015\/12\/types.png\" alt=\"types\" width=\"1048\" height=\"393\" class=\"aligncenter size-full wp-image-2200\" srcset=\"https:\/\/blog.xcir.net\/wp-content\/uploads\/2015\/12\/types.png 1048w, https:\/\/blog.xcir.net\/wp-content\/uploads\/2015\/12\/types-300x113.png 300w, https:\/\/blog.xcir.net\/wp-content\/uploads\/2015\/12\/types-1024x384.png 1024w\" sizes=\"auto, (max-width: 1048px) 100vw, 1048px\" \/><\/a><br \/>\n\u306a\u304a\u3001\u3053\u3053\u3067\u306f\u7279\u306b\u5909\u63db\u306b\u304b\u304b\u308f\u3089\u306a\u3044\u578b\u306b\u3064\u3044\u3066\u306f\u53d6\u308a\u4e0a\u3052\u3066\u3044\u307e\u305b\u3093(BLOB,ENUM,HTTP,PRIV_CALL,PRIV_VCL,PRIV_TASK,PRIV_TOP,PROBE,VOID)<\/p>\n<p>\u3061\u306a\u307f\u306b\u5404\u578b\u304b\u3089\u6697\u9ed9\u7684\u306bSTRING\u3078\u5909\u63db\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<table>\n<tr>\n<th>\u578b<\/th>\n<th>\u5909\u63db\u4f8b<\/th>\n<\/tr>\n<tr>\n<td>BYTES<\/td>\n<td>2.000<\/td>\n<\/tr>\n<tr>\n<td>DURATION<\/td>\n<td>2.000<\/td>\n<\/tr>\n<tr>\n<td>REAL<\/td>\n<td>2.000<\/td>\n<\/tr>\n<tr>\n<td>BOOL<\/td>\n<td>false<\/td>\n<\/tr>\n<tr>\n<td>BACKEND<\/td>\n<td>default<\/td>\n<\/tr>\n<tr>\n<td>INT<\/td>\n<td>1<\/td>\n<\/tr>\n<tr>\n<td>IP<\/td>\n<td>192.168.1.1<\/td>\n<\/tr>\n<tr>\n<td>TIME<\/td>\n<td>Fri, 04 Dec 2015 18:31:12 GMT<\/td>\n<\/tr>\n<tr>\n<td>HEADER<\/td>\n<td>example.net<\/td>\n<\/tr>\n<\/table>\n<p>\u307e\u305f\u3001STRING_LIST\u3067\u3059\u304c\u57fa\u672c\u7684\u306b\u306fSTRING\u3068\u7279\u306b\u9055\u3044\u306f\u306a\u3044\u306e\u3067\u3059\u304c\u3001<br \/>\n\u3053\u308c\u3092\u5f15\u6570\u3068\u3057\u3066\u53d7\u3051\u4ed8\u3051\u308b\u95a2\u6570\u306e\u5834\u5408\u306f\u578b\u5909\u63db\u3092\u610f\u8b58\u3057\u306a\u3044\u3068\u30cf\u30de\u308a\u307e\u3059\u3002<br \/>\n\u4f8b\u3048\u3070std.log\u3068\u3044\u3046\u30ed\u30b0\u3092\u51fa\u529b\u3059\u308b\u95a2\u6570\u304c\u3042\u308b\u306e\u3067\u3059\u304c\u3001\u3053\u308c\u306f\u5f15\u6570\u304cSTRING_LIST\u3067\u3059\u3002<br \/>\n\u305d\u308c\u3092\u610f\u8b58\u3057\u3066\u4ee5\u4e0b\u306e\u3088\u3046\u306aVCL\u3092\u66f8\u304f\u3068\u30a8\u30e9\u30fc\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; \">\n\r\nstd.log(std.duration(&quot;10w&quot;,0s));\r\n\n<\/pre>\n<pre class=\"brush: plain; \">\n\r\nCommand failed with error code 106\r\nMessage from VCC-compiler:\r\nWrong argument type.  Expected STRING_LIST.  Got DURATION.\r\n(&#039;input&#039; Line 31 Pos 31)\r\nstd.log(std.duration(&quot;10w&quot;,0s));\r\n------------------------------#-\r\n(&#039;input&#039; Line 31 Pos 1) -- (&#039;input&#039; Line 31 Pos 30)\r\nstd.log(std.duration(&quot;10w&quot;,0s));\r\n##############################--\r\nRunning VCC-compiler failed, exited with 2\r\n\n<\/pre>\n<p>\u3053\u308c\u306fduration\u304b\u3089\u4e00\u6c17\u306bSTRING_LIST\u306b\u6697\u9ed9\u7684\u306b\u5909\u63db\u3067\u304d\u306a\u3044\u304b\u3089\u3067\u3059\u3002<br \/>\n\u305d\u3053\u3067\u3069\u3046\u3084\u308b\u304b\u3068\u3044\u3046\u3068\u3001\u4e00\u5ea6STRING\u3092\u7d4c\u7531\u3055\u305b\u3066\u3042\u3052\u308c\u3070\u3088\u3044\u306e\u3067<\/p>\n<pre class=\"brush: plain; \">\n\r\nstd.log(&quot;&quot; + std.duration(&quot;10w&quot;,0s));\r\n\n<\/pre>\n<p>\u3053\u306e\u3088\u3046\u306b\u7a7a\u6587\u5b57\u3092\u7d50\u5408\u3059\u308b\u3068\u826f\u3044\u3067\u3059\u3002<\/p>\n<p><strong>\u307e\u3068\u3081<\/strong><br \/>\n\u5909\u6570\u304c\u3069\u306e\u3088\u3046\u306b\u578b\u5909\u63db\u304c\u51fa\u304d\u308b\u304b\u3092\u77e5\u3063\u3066\u304a\u304f\u3068\u3001\u305d\u306e\u578b\u3067\u306f\u51fa\u6765\u306a\u3044\u6f14\u7b97\u3092\u5909\u63db\u3057\u305f\u5148\u3067\u3084\u3063\u3066\u623b\u3059\u307f\u305f\u3044\u306a\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<br \/>\n\u899a\u3048\u3066\u304a\u304f\u3068\u7d50\u69cb\u4fbf\u5229\u306a\u306e\u3067\u3001\u982d\u306e\u7247\u9685\u306b\u7f6e\u3044\u3066\u304a\u304f\u3068\u826f\u3044\u304b\u306a\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<div class='wp_social_bookmarking_light'>        <div class=\"wsbl_hatena\"><a href='\/\/b.hatena.ne.jp\/add?mode=confirm&url=https%3A%2F%2Fblog.xcir.net%2F%3Fp%3D2199&title=VCL%E3%81%AE%E5%A4%89%E6%95%B0%E3%81%AE%E5%9E%8B%E5%A4%89%E6%8F%9B%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A6%28vmod_std%29' title='\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0' rel=nofollow class='wp_social_bookmarking_light_a' target=_blank><img src='https:\/\/blog.xcir.net\/wp-content\/plugins\/wp-social-bookmarking-light\/public\/images\/hatena.gif' alt='\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0' title='\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0' width='16' height='12' class='wp_social_bookmarking_light_img' \/><\/a><\/div>        <div class=\"wsbl_hatena_users\"><a href='\/\/b.hatena.ne.jp\/entry\/https:\/\/blog.xcir.net\/?p=2199' title='\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af - VCL\u306e\u5909\u6570\u306e\u578b\u5909\u63db\u306b\u3064\u3044\u3066(vmod_std)' rel=nofollow class='wp_social_bookmarking_light_a' target=_blank><img src='\/\/b.hatena.ne.jp\/entry\/image\/https:\/\/blog.xcir.net\/?p=2199' alt='\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af - VCL\u306e\u5909\u6570\u306e\u578b\u5909\u63db\u306b\u3064\u3044\u3066(vmod_std)' title='\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af - VCL\u306e\u5909\u6570\u306e\u578b\u5909\u63db\u306b\u3064\u3044\u3066(vmod_std)'   class='wp_social_bookmarking_light_img' \/><\/a><\/div>        <div class=\"wsbl_facebook\"><a href='http:\/\/www.facebook.com\/share.php?u=https%3A%2F%2Fblog.xcir.net%2F%3Fp%3D2199&t=VCL%E3%81%AE%E5%A4%89%E6%95%B0%E3%81%AE%E5%9E%8B%E5%A4%89%E6%8F%9B%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A6%28vmod_std%29' title='Facebook \u306b\u30b7\u30a7\u30a2' rel=nofollow class='wp_social_bookmarking_light_a' target=_blank><img src='https:\/\/blog.xcir.net\/wp-content\/plugins\/wp-social-bookmarking-light\/public\/images\/facebook.png' alt='Facebook \u306b\u30b7\u30a7\u30a2' title='Facebook \u306b\u30b7\u30a7\u30a2' width='16' height='16' class='wp_social_bookmarking_light_img' \/><\/a><\/div>        <div class=\"wsbl_linkedin\"><a href='\/\/www.linkedin.com\/shareArticle?mini=true&url=https%3A%2F%2Fblog.xcir.net%2F%3Fp%3D2199&title=VCL%E3%81%AE%E5%A4%89%E6%95%B0%E3%81%AE%E5%9E%8B%E5%A4%89%E6%8F%9B%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A6%28vmod_std%29' title='LinkedIn \u306b\u30b7\u30a7\u30a2' rel=nofollow class='wp_social_bookmarking_light_a' target=_blank><img src='https:\/\/blog.xcir.net\/wp-content\/plugins\/wp-social-bookmarking-light\/public\/images\/linkedin.png' alt='LinkedIn \u306b\u30b7\u30a7\u30a2' title='LinkedIn \u306b\u30b7\u30a7\u30a2' width='16' height='16' class='wp_social_bookmarking_light_img' \/><\/a><\/div>        <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"https:\/\/blog.xcir.net\/?p=2199\" data-text=\"VCL\u306e\u5909\u6570\u306e\u578b\u5909\u63db\u306b\u3064\u3044\u3066(vmod_std)\" data-lang=\"ja\">Tweet<\/a><\/div><\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u306e\u8a18\u4e8b\u306fVarnish Cache Advent Calendar 2015\u306e4\u65e5\u76ee\u306e\u8a18\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002 VCL\u306b\u306f\u69d8\u3005\u306a\u5909\u6570\u306e\u578b\u304c\u3042\u308a\u307e\u3057\u3066\u3001\u305d\u308c\u305e\u308c\u306e\u578b\u306e\u9593\u3067\u306f\u6697\u9ed9\u7684\u306b\u5909\u63db\u3055\u308c\u308b\u3082\u306e\u3068\u3001vmod_std\u3092\u4f7f\u7528\u3057\u3066\u660e\u793a <a href='https:\/\/blog.xcir.net\/?p=2199' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[5,60],"class_list":["post-2199","post","type-post","status-publish","format-standard","hentry","category-3","tag-varnish","tag-varnish4-1-0","category-3-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"_links":{"self":[{"href":"https:\/\/blog.xcir.net\/index.php?rest_route=\/wp\/v2\/posts\/2199","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.xcir.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.xcir.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.xcir.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.xcir.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2199"}],"version-history":[{"count":7,"href":"https:\/\/blog.xcir.net\/index.php?rest_route=\/wp\/v2\/posts\/2199\/revisions"}],"predecessor-version":[{"id":2207,"href":"https:\/\/blog.xcir.net\/index.php?rest_route=\/wp\/v2\/posts\/2199\/revisions\/2207"}],"wp:attachment":[{"href":"https:\/\/blog.xcir.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.xcir.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.xcir.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}