<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
        <title>软件工程 - 分类 - MartinLwx&#39;s Blog</title>
        <link>https://martinlwx.github.io/zh-cn/categories/%E8%BD%AF%E4%BB%B6%E5%B7%A5%E7%A8%8B/</link>
        <description>软件工程 - 分类 - MartinLwx&#39;s Blog</description>
        <generator>Hugo -- gohugo.io</generator><language>zh-CN</language><managingEditor>martinlwx@163.com (MartinLwx)</managingEditor>
            <webMaster>martinlwx@163.com (MartinLwx)</webMaster><copyright>&lt;a rel=&#34;license noopener&#34; href=&#34;https://creativecommons.org/licenses/by-nc-nd/4.0/&#34; target=&#34;_blank&#34;&gt;CC BY-NC-ND 4.0&lt;/a&gt;</copyright><lastBuildDate>Mon, 20 Apr 2026 00:32:07 &#43;0800</lastBuildDate><atom:link href="https://martinlwx.github.io/zh-cn/categories/%E8%BD%AF%E4%BB%B6%E5%B7%A5%E7%A8%8B/" rel="self" type="application/rss+xml" /><item>
    <title>Drain: 简单有效的日志解析算法</title>
    <link>https://martinlwx.github.io/zh-cn/log-parsing-algorithm-drain/</link>
    <pubDate>Mon, 20 Apr 2026 00:32:07 &#43;0800</pubDate><author>
        <name>MartinLwx</name>
    </author><guid>https://martinlwx.github.io/zh-cn/log-parsing-algorithm-drain/</guid>
    <description><![CDATA[<h2 id="研究背景" class="headerLink">
    <a href="#%e7%a0%94%e7%a9%b6%e8%83%8c%e6%99%af" class="header-mark"></a>研究背景</h2><p>很多云平台都有各种日志，但是并不是结构化的，但利用机器学习/数据挖掘从日志中挖掘信息的时候又希望输入是结构化数据</p>
<p>因此，如何<strong>从非结构化日志中提取结构化信息</strong>是一件很重要的事情，一个朴素的想法是：使用正则表达式自己做解析提取，但是这个方法有很多缺点<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup></p>
<ul>
<li>日志的量太多，肉眼看日志然后写正则表达式不可取</li>
<li>日志来自系统里的每一个组件，每一个组件背后的开发者可能都有自己的写日志习惯，一个个适配太麻烦</li>
</ul>
<p>在 Drain 算法被提出的时候（2017 年），很多日志解析手段都聚焦于<strong>离线批处理</strong>场景，但云平台的日志经常都是流式产生的，因此 Drain 算法聚焦<strong>在线流式处理</strong>场景，它可以自动从非结构化日志中挖掘日志模板，从而得到结构化数据</p>]]></description>
</item></channel>
</rss>
