{"id":1366,"date":"2021-08-02T01:13:45","date_gmt":"2021-08-01T16:13:45","guid":{"rendered":"https:\/\/ito-u-oti.com\/?p=1366"},"modified":"2021-08-02T01:13:49","modified_gmt":"2021-08-01T16:13:49","slug":"nginx-logformat","status":"publish","type":"post","link":"https:\/\/ito-u-oti.com\/?p=1366","title":{"rendered":"nginx\u306eLogFormat\u8a2d\u5b9a\u306e\u6539\u5584"},"content":{"rendered":"\n<p>nginx\u306e\u30ed\u30b0\u3092\u81ea\u5206\u306a\u308a\u306b\u6700\u9069\u5316\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 id=\"outline__1\" class=\"wp-block-heading\">\u30c7\u30d5\u30a9\u30eb\u30c8\u8a2d\u5b9a<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\nlog_format  main  '$remote_addr - $remote_user &#x5B;$time_local] &quot;$request&quot; '\n                  '$status $body_bytes_sent &quot;$http_referer&quot; '\n                  '&quot;$http_user_agent&quot; &quot;$http_x_forwarded_for&quot;';\n\n<\/pre><\/div>\n\n\n<p>\u30ed\u30b0\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u51fa\u529b\u3055\u308c\u308b<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\n172.17.0.1 - - &#x5B;01\/Aug\/2021:02:48:02 +0900] &quot;GET \/ HTTP\/1.1&quot; 200 612 &quot;-&quot; &quot;curl\/7.64.1&quot; &quot;-&quot;\n172.17.0.1 - - &#x5B;01\/Aug\/2021:02:48:03 +0900] &quot;GET \/ HTTP\/1.1&quot; 200 612 &quot;-&quot; &quot;curl\/7.64.1&quot; &quot;-&quot;\n172.17.0.1 - - &#x5B;01\/Aug\/2021:02:48:04 +0900] &quot;GET \/ HTTP\/1.1&quot; 200 612 &quot;-&quot; &quot;curl\/7.64.1&quot; &quot;-&quot;\n\n<\/pre><\/div>\n\n\n<p>\u306a\u3093\u3068\u306a\u304f\u306f\u5206\u304b\u308b\u304c\u3001\u30cf\u30a4\u30d5\u30f3\u306b\u306a\u3063\u3066\u3044\u308b\u90e8\u5206\u3084\u6570\u5b57\u306a\u3069\u304c\u4f55\u3092\u8868\u3057\u3066\u3044\u308b\u306e\u304b\u306f\u5206\u304b\u308a\u3065\u3089\u304f\u306a\u3063\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<h2 id=\"outline__2\" class=\"wp-block-heading\">\u6539\u5584\u5f8c<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\n    log_format  main  '&quot;$time_local&quot; client=$remote_addr '\n                      'method=$request_method request=&quot;$request&quot; '\n                      'request_length=&quot;$request_length&quot; '\n                      'request_uri=&quot;$request_uri&quot; '\n                      'request_body=&quot;$request_body&quot; '\n                      #   If the header contains a module and you want to output it in the log\n                      #   'module=&quot;$http_module&quot; '\n                      #   If the cookie contains a sessionid and you want to output it in the log\n                      #   'session_id=&quot;$cookie_sessionId&quot; '\n                      'status=$status bytes_sent=$bytes_sent '\n                      'body_bytes_sent=$body_bytes_sent '\n                      'referer=$http_referer '\n                      'user_agent=&quot;$http_user_agent&quot; '\n                      'forwarded_for=&quot;$http_x_forwarded_for&quot; '\n                      'request_time=$request_time '\n                      'upstream_addr=$upstream_addr '\n                      'upstream_status=$upstream_status '\n                      'upstream_response_time=&quot;$upstream_response_time&quot;ms '\n                      'upstream_connect_time=&quot;$upstream_connect_time&quot;ms '\n                      'upstream_header_time=&quot;$upstream_header_time&quot;ms ';\n\n<\/pre><\/div>\n\n\n<p>\u30ed\u30b0\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u51fa\u529b\u3055\u308c\u308b<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\n&quot;02\/Aug\/2021:01:01:01 +0900&quot; client=172.17.0.1 method=GET request=&quot;GET \/ HTTP\/1.1&quot; request_length=&quot;78&quot; request_uri=&quot;\/&quot; request_body=&quot;-&quot; status=200 bytes_sent=850 body_bytes_sent=612 referer=- user_agent=&quot;curl\/7.64.1&quot; forwarded_for=&quot;-&quot; request_time=0.000 upstream_addr=- upstream_status=- upstream_response_time=&quot;-&quot;ms upstream_connect_time=&quot;-&quot;ms upstream_header_time=&quot;-&quot;ms \n&quot;02\/Aug\/2021:01:01:03 +0900&quot; client=172.17.0.1 method=GET request=&quot;GET \/ HTTP\/1.1&quot; request_length=&quot;78&quot; request_uri=&quot;\/&quot; request_body=&quot;-&quot; status=200 bytes_sent=850 body_bytes_sent=612 referer=- user_agent=&quot;curl\/7.64.1&quot; forwarded_for=&quot;-&quot; request_time=0.000 upstream_addr=- upstream_status=- upstream_response_time=&quot;-&quot;ms upstream_connect_time=&quot;-&quot;ms upstream_header_time=&quot;-&quot;ms \n&quot;02\/Aug\/2021:01:01:03 +0900&quot; client=172.17.0.1 method=GET request=&quot;GET \/ HTTP\/1.1&quot; request_length=&quot;78&quot; request_uri=&quot;\/&quot; request_body=&quot;-&quot; status=200 bytes_sent=850 body_bytes_sent=612 referer=- user_agent=&quot;curl\/7.64.1&quot; forwarded_for=&quot;-&quot; request_time=0.000 upstream_addr=- upstream_status=- upstream_response_time=&quot;-&quot;ms upstream_connect_time=&quot;-&quot;ms upstream_header_time=&quot;-&quot;ms\n\n<\/pre><\/div>\n\n\n<p>\u5404\u9805\u76ee\u306b\u4f55\u3092\u51fa\u529b\u3057\u3066\u3044\u308b\u304b\u3092\u51fa\u529b\u3059\u308b\u3053\u3068\u3067\u3001\u51fa\u529b\u5024\u306e\u610f\u5473\u304c\u308f\u304b\u308b\u3088\u3046\u306b\u3057\u305f\u3002<br>time\u3092\u51fa\u529b\u3059\u308b\u7cfb\u306e\u9805\u76ee\u306b\u3064\u3044\u3066\u306f\u5358\u4f4d\uff08\u30df\u30ea\u79d2\uff09\u3092\u3064\u3051\u308b\u3088\u3046\u306b\u3057\u305f\u3002<br>\u307e\u305f\u3001\u8ffd\u52a0\u3067upstream\u7cfb\u306e\u60c5\u5831\u306a\u3069\u3092\u8ffd\u52a0\u3057\u305f\u3002<\/p>\n\n\n\n<h2 id=\"outline__3\" class=\"wp-block-heading\">\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u306e\u90e8\u5206\u306b\u3064\u3044\u3066<\/h2>\n\n\n\n<h3 id=\"outline__3_1\" class=\"wp-block-heading\">header\u306e\u4efb\u610f\u306e\u5024\u3092\u51fa\u529b\u3057\u305f\u3044<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\n#   If the header contains a module and you want to output it in the log\n#   'module=&quot;$http_module&quot; '\n\n<\/pre><\/div>\n\n\n<p>header\u306b\u3042\u308b\u5024\u3092\u51fa\u529b\u3059\u308b\u306b\u306f <code>$http_***<\/code>\u3092\u4f7f\u3046<\/p>\n\n\n\n<h3 id=\"outline__3_2\" class=\"wp-block-heading\">Cookie\u306e\u4efb\u610f\u306e\u5024\u3092\u51fa\u529b\u3057\u305f\u3044<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\n#   If the cookie contains a sessionid and you want to output it in the log\n#   'session_id=&quot;$cookie_sessionId&quot; '\n\n<\/pre><\/div>\n\n\n<p>Cookie\u306b\u3042\u308b\u5024\u3092\u51fa\u529b\u3059\u308b\u306b\u306f <code>$cookie_***<\/code> \u3092\u4f7f\u3046<\/p>\n\n\n\n<h2 id=\"outline__4\" class=\"wp-block-heading\">\u53c2\u8003<\/h2>\n\n\n\n<p><a href=\"https:\/\/qiita.com\/r-ytakada\/items\/ebe943366f59d29e0a50\">nginx Embedded Variables\u306e\u4e00\u89a7<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>nginx\u306e\u30ed\u30b0\u3092\u81ea\u5206\u306a\u308a\u306b\u6700\u9069\u5316\u3057\u307e\u3059\u3002 \u30c7\u30d5\u30a9\u30eb\u30c8\u8a2d\u5b9a \u30ed\u30b0\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u51fa\u529b\u3055\u308c\u308b \u306a\u3093\u3068\u306a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1361,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[307],"tags":[310,308],"class_list":["post-1366","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-nginx","tag-logformat","tag-nginx"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/posts\/1366","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1366"}],"version-history":[{"count":2,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/posts\/1366\/revisions"}],"predecessor-version":[{"id":1368,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/posts\/1366\/revisions\/1368"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/media\/1361"}],"wp:attachment":[{"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1366"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1366"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1366"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}