<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Filebeat on Even - A super concise theme for Hugo</title><link>https://lppgo.github.io/tags/filebeat/</link><description>Recent content in Filebeat on Even - A super concise theme for Hugo</description><generator>Hugo</generator><language>en</language><lastBuildDate>Mon, 13 Jul 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://lppgo.github.io/tags/filebeat/index.xml" rel="self" type="application/rss+xml"/><item><title>Go日志分析系统-ELK实时日志监控</title><link>https://lppgo.github.io/post/golang/040_go%E6%97%A5%E5%BF%97%E5%88%86%E6%9E%90%E7%B3%BB%E7%BB%9F-elk%E5%AE%9E%E6%97%B6%E6%97%A5%E5%BF%97%E7%9B%91%E6%8E%A7/</link><pubDate>Mon, 13 Jul 2026 00:00:00 +0000</pubDate><guid>https://lppgo.github.io/post/golang/040_go%E6%97%A5%E5%BF%97%E5%88%86%E6%9E%90%E7%B3%BB%E7%BB%9F-elk%E5%AE%9E%E6%97%B6%E6%97%A5%E5%BF%97%E7%9B%91%E6%8E%A7/</guid><description>&lt;div align="center">&lt;font size="35">Go日志分析系统-ELK实时日志监控&lt;/font>&lt;/div>
&lt;h1 id="1-概述与适用范围">1: 概述与适用范围&lt;/h1>
&lt;ul>
&lt;li>本文搭建一套可在单台开发机运行的日志采集与检索环境，完整链路为：&lt;code>Go 应用 -&amp;gt; JSON 日志文件 -&amp;gt; Filebeat -&amp;gt; Logstash -&amp;gt; Elasticsearch -&amp;gt; Kibana&lt;/code>；&lt;/li>
&lt;li>Go 应用负责逐行写入结构化 JSON，Filebeat 负责增量读取文件，Logstash 负责接收和转发，Elasticsearch 负责存储与检索，Kibana 负责可视化查询；&lt;/li>
&lt;li>教程面向 Go 开发者和初级 DevOps 工程师，重点是先跑通一个可观察、可排障的最小闭环；&lt;/li>
&lt;li>本文的 Compose 配置关闭了 Elastic 安全认证，&lt;strong>仅允许用于本机学习，禁止直接暴露到公网或照搬到生产环境&lt;/strong>；&lt;/li>
&lt;li>原文参考：&lt;a href="https://mp.weixin.qq.com/s/wdotnnhFI2NfNkp5hnenaQ">Go日志分析系统-ELK实时日志监控&lt;/a>。&lt;/li>
&lt;/ul>
&lt;h1 id="2-elkfilebeat-组件职责">2: ELK/Filebeat 组件职责&lt;/h1>
&lt;table>
 &lt;thead>
 &lt;tr>
 &lt;th>组件&lt;/th>
 &lt;th>职责&lt;/th>
 &lt;th>本文端口&lt;/th>
 &lt;/tr>
 &lt;/thead>
 &lt;tbody>
 &lt;tr>
 &lt;td>Go 应用&lt;/td>
 &lt;td>生成逐行 JSON 业务日志&lt;/td>
 &lt;td>无&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>Filebeat&lt;/td>
 &lt;td>追踪文件读取位置，将新增日志发送给 Logstash&lt;/td>
 &lt;td>无&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>Logstash&lt;/td>
 &lt;td>通过 Beats input 接收事件，并写入指定索引&lt;/td>
 &lt;td>&lt;code>5044&lt;/code>，监控 API &lt;code>9600&lt;/code>&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>Elasticsearch&lt;/td>
 &lt;td>存储、索引和查询日志&lt;/td>
 &lt;td>&lt;code>9200&lt;/code>&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>Kibana&lt;/td>
 &lt;td>创建 Data View，使用 KQL 检索日志&lt;/td>
 &lt;td>&lt;code>5601&lt;/code>&lt;/td>
 &lt;/tr>
 &lt;/tbody>
&lt;/table>
&lt;ul>
&lt;li>Filebeat 比直接让 Go 应用调用 Elasticsearch 更容易处理断线重试、读取进度和日志轮转；&lt;/li>
&lt;li>Logstash 在这个入门示例中只做轻量转发。后续需要字段清洗、脱敏或路由时，可以在 pipeline 中增加 filter；&lt;/li>
&lt;li>Elasticsearch 和 Kibana 比较消耗内存，启动前应确认 Docker 可用资源充足。&lt;/li>
&lt;/ul>
&lt;h1 id="3-数据流与示例目录">3: 数据流与示例目录&lt;/h1>
&lt;p>数据流如下：&lt;/p></description></item></channel></rss>