<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
        <title>ELK - Tag - VPSDeck - VPS 测评与技术教程</title>
        <link>https://vpsdeck.com/tags/elk/</link>
        <description>ELK - Tag - VPSDeck - VPS 测评与技术教程</description>
        <generator>Hugo -- gohugo.io</generator><language>zh-CN</language><managingEditor>michaelho2017@hotmail.com (VPSDeck)</managingEditor>
            <webMaster>michaelho2017@hotmail.com (VPSDeck)</webMaster><lastBuildDate>Wed, 15 Jul 2026 20:05:00 &#43;0800</lastBuildDate><atom:link href="https://vpsdeck.com/tags/elk/" rel="self" type="application/rss+xml" /><item>
    <title>Nginx 日志格式改造：从 Combined 到结构化 JSON（Nginx 系列第 2 期）</title>
    <link>https://vpsdeck.com/nginx-json-log-format/</link>
    <pubDate>Wed, 15 Jul 2026 20:05:00 &#43;0800</pubDate>
    <author>michaelho2017@hotmail.com (VPSDeck)</author>
    <guid>https://vpsdeck.com/nginx-json-log-format/</guid>
    <description><![CDATA[<p>Nginx 系列：<a href="/compile-install-nginx/" rel="">第 1 期：源码编译安装</a> · <a href="/nginx-fancyindex-file-server/" rel="">第 3 期：FancyIndex 文件服务器</a></p>
<hr>
<h2 id="1-为什么需要-json-格式日志">1. 为什么需要 JSON 格式日志？</h2>
<h3 id="11-nginx-默认日志长什么样">1.1 Nginx 默认日志长什么样</h3>
<p>Nginx 默认的 <code>combined</code> 日志格式：</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">192.168.1.100 - - [16/Jul/2026:14:30:00 +0800] &#34;GET /api/users HTTP/1.1&#34; 200 1234 &#34;https://example.com/&#34; &#34;Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36&#34;</span></span></code></pre></div></div>
<p>这条日志包含 7 个字段，用空格和引号分隔。看起来挺整齐——直到你发现 User-Agent 里有个空格：</p>]]></description>
</item>
</channel>
</rss>
