ingress-nginx-helm/user-guide/nginx-configuration/log-format/index.html

6 lines
26 KiB
HTML
Raw Permalink Normal View History

2024-09-15 15:04:08 +00:00
<!doctype html><html lang=en class=no-js> <head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link href=https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/log-format/ rel=canonical><link href=../custom-template/ rel=prev><link href=../../cli-arguments/ rel=next><link rel=icon href=../../../assets/images/favicon.png><meta name=generator content="mkdocs-1.5.3, mkdocs-material-9.4.5"><title>Log format - Ingress-Nginx Controller</title><link rel=stylesheet href=../../../assets/stylesheets/main.6a10b989.min.css><link rel=stylesheet href=../../../assets/stylesheets/palette.356b1318.min.css><link rel=preconnect href=https://fonts.gstatic.com crossorigin><link rel=stylesheet href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback"><style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style><link rel=stylesheet href=../../../extra.css><script>__md_scope=new URL("../../..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script></head> <body dir=ltr data-md-color-scheme=default data-md-color-primary=teal data-md-color-accent=green> <input class=md-toggle data-md-toggle=drawer type=checkbox id=__drawer autocomplete=off> <input class=md-toggle data-md-toggle=search type=checkbox id=__search autocomplete=off> <label class=md-overlay for=__drawer></label> <div data-md-component=skip> <a href=#log-format class=md-skip> Skip to content </a> </div> <div data-md-component=announce> </div> <header class="md-header md-header--shadow md-header--lifted" data-md-component=header> <nav class="md-header__inner md-grid" aria-label=Header> <a href=../../.. title="Ingress-Nginx Controller" class="md-header__button md-logo" aria-label="Ingress-Nginx Controller" data-md-component=logo> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg> </a> <label class="md-header__button md-icon" for=__drawer> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z"/></svg> </label> <div class=md-header__title data-md-component=header-title> <div class=md-header__ellipsis> <div class=md-header__topic> <span class=md-ellipsis> Ingress-Nginx Controller </span> </div> <div class=md-header__topic data-md-component=header-topic> <span class=md-ellipsis> Log format </span> </div> </div> </div> <label class="md-header__button md-icon" for=__search> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg> </label> <div class=md-search data-md-component=search role=dialog> <label class=md-search__overlay for=__search></label> <div class=md-search__inner role=search> <form class=md-search__form name=search> <input type=text class=md-search__input name=query aria-label=Search placeholder=Search autocapitalize=off autocorrect=off autocomplete=off spellcheck=false data-md-component=search-query required> <label class="md-search__icon md-icon" for=__search> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"/></svg> </label> <nav class=md-search__options aria-label=Search> <button type=
2020-04-15 17:09:38 +00:00
&#39;$remote_addr - $remote_user [$time_local] &quot;$request&quot; &#39;
&#39;$status $body_bytes_sent &quot;$http_referer&quot; &quot;$http_user_agent&quot; &#39;
&#39;$request_length $request_time [$proxy_upstream_name] [$proxy_alternative_upstream_name] $upstream_addr &#39;
&#39;$upstream_response_length $upstream_response_time $upstream_status $req_id&#39;;
2023-10-12 19:31:18 +00:00
</code></pre></div> <table> <thead> <tr> <th>Placeholder</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>$proxy_protocol_addr</code></td> <td>remote address if proxy protocol is enabled</td> </tr> <tr> <td><code>$remote_addr</code></td> <td>the source IP address of the client</td> </tr> <tr> <td><code>$remote_user</code></td> <td>user name supplied with the Basic authentication</td> </tr> <tr> <td><code>$time_local</code></td> <td>local time in the Common Log Format</td> </tr> <tr> <td><code>$request</code></td> <td>full original request line</td> </tr> <tr> <td><code>$status</code></td> <td>response status</td> </tr> <tr> <td><code>$body_bytes_sent</code></td> <td>number of bytes sent to a client, not counting the response header</td> </tr> <tr> <td><code>$http_referer</code></td> <td>value of the Referer header</td> </tr> <tr> <td><code>$http_user_agent</code></td> <td>value of User-Agent header</td> </tr> <tr> <td><code>$request_length</code></td> <td>request length (including request line, header, and request body)</td> </tr> <tr> <td><code>$request_time</code></td> <td>time elapsed since the first bytes were read from the client</td> </tr> <tr> <td><code>$proxy_upstream_name</code></td> <td>name of the upstream. The format is <code>upstream-&lt;namespace&gt;-&lt;service name&gt;-&lt;service port&gt;</code></td> </tr> <tr> <td><code>$proxy_alternative_upstream_name</code></td> <td>name of the alternative upstream. The format is <code>upstream-&lt;namespace&gt;-&lt;service name&gt;-&lt;service port&gt;</code></td> </tr> <tr> <td><code>$upstream_addr</code></td> <td>the IP address and port (or the path to the domain socket) of the upstream server. If several servers were contacted during request processing, their addresses are separated by commas.</td> </tr> <tr> <td><code>$upstream_response_length</code></td> <td>the length of the response obtained from the upstream server</td> </tr> <tr> <td><code>$upstream_response_time</code></td> <td>time spent on receiving the response from the upstream server as seconds with millisecond resolution</td> </tr> <tr> <td><code>$upstream_status</code></td> <td>status code of the response obtained from the upstream server</td> </tr> <tr> <td><code>$req_id</code></td> <td>value of the <code>X-Request-ID</code> HTTP header. If the header is not set, a randomly generated ID.</td> </tr> </tbody> </table> <p>Additional available variables:</p> <table> <thead> <tr> <th>Placeholder</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>$namespace</code></td> <td>namespace of the ingress</td> </tr> <tr> <td><code>$ingress_name</code></td> <td>name of the ingress</td> </tr> <tr> <td><code>$service_name</code></td> <td>name of the service</td> </tr> <tr> <td><code>$service_port</code></td> <td>port of the service</td> </tr> </tbody> </table> <p>Sources:</p> <ul> <li><a href=https://nginx.org/en/docs/http/ngx_http_upstream_module.html#variables>Upstream variables</a></li> <li><a href=https://nginx.org/en/docs/http/ngx_http_core_module.html#variables>Embedded variables</a></li> </ul> </article> </div> </div> </main> <footer class=md-footer> <div class="md-footer-meta md-typeset"> <div class="md-footer-meta__inner md-grid"> <div class=md-copyright> Made with <a href=https://squidfunk.github.io/mkdocs-material/ target=_blank rel=noopener> Material for MkDocs </a> </div> </div> </div> </footer> </div> <div class=md-dialog data-md-component=dialog> <div class="md-dialog__inner md-typeset"></div> </div> <script id=__config type=application/json>{"base": "../../..", "features": ["navigation.tabs", "navigation.tabs.sticky", "navigation.instant", "navigation.sections"], "search": "../../../assets/javascripts/workers/search.f886a092.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search