<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Vector on Cylon&#39;s Collection</title>
    <link>https://www.161616.top/tags/vector/</link>
    <description>Recent content in Vector on Cylon&#39;s Collection</description>
    <generator>Hugo -- 0.125.7</generator>
    <language>zh-CN</language>
    <lastBuildDate>Mon, 20 Jul 2026 23:00:36 +0800</lastBuildDate>
    <atom:link href="https://www.161616.top/tags/vector/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>阶段5 - Vector Transforms和VRL</title>
      <link>https://www.161616.top/vector-transforms/</link>
      <pubDate>Mon, 20 Jul 2026 00:00:00 +0000</pubDate>
      <guid>https://www.161616.top/vector-transforms/</guid>
      <description>了解 Vector 的结构 Vector 配置由三种组件组成：
text 1 Sources → Transforms → Sinks Sources：负责接收数据，例如 file
Transforms：负责处理数据，例如 remap
Sinks：负责发送数据，例如 elasticsearch
一个示例配置文件结构
yaml 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 sources: app_logs: type: file include: - /var/log/app/*.log transforms: parse_app_logs: type: remap inputs: - app_logs source: | .service = &amp;#34;payment&amp;#34; sinks: elasticsearch: type: elasticsearch inputs: - parse_app_logs 总结：Transforms 是在数据流经 Vector 拓扑时，对数据进行塑形和处理。
Transform 配置的 Schema transform 具有下面的结构：</description>
    </item>
    <item>
      <title>阶段5-1 - 初识 VRL</title>
      <link>https://www.161616.top/vector-vrl/</link>
      <pubDate>Mon, 20 Jul 2026 00:00:00 +0000</pubDate>
      <guid>https://www.161616.top/vector-vrl/</guid>
      <description>第一步：Hello world - 让VRL运行起来 日志输入 当用户在在终端输入 “hello”；Vector 的 stdin Source 会把它变成一个日志事件。
为了便于学习，可以先把它理解成：
text 1 2 3 { &amp;#34;message&amp;#34;: &amp;#34;hello&amp;#34; } 我们的目标是把事件改成：
text 1 2 3 4 { &amp;#34;message&amp;#34;: &amp;#34;hello&amp;#34;, &amp;#34;service&amp;#34;: &amp;#34;payment&amp;#34; } 第一条 VRL 语句 给当前事件增加一个名为 service 的字段， 字段值设置为字符串 payment。
text 1 .service = &amp;#34;payment&amp;#34; “.”：当前正在处理的事件。上面示例是 “message=hello”，这就是当前事件 “service” 是字段名，嵌套和 js 对象使用一样, “.parent.child” “.service” 就是指当前事件的 service 字段 “.service = &amp;ldquo;payment&amp;rdquo;”：“=”为赋值符号，把字符串 payment 放入当前事件的 service 字段。 完整的 VRL 示例
yaml 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 sources: input: type: stdin transforms: add_service: type: remap inputs: - input source: | .</description>
    </item>
    <item>
      <title>阶段5-2 - 值、字段与最基础赋值</title>
      <link>https://www.161616.top/vector-transforms-and-vrl/</link>
      <pubDate>Mon, 20 Jul 2026 00:00:00 +0000</pubDate>
      <guid>https://www.161616.top/vector-transforms-and-vrl/</guid>
      <description>VRL 值 什么是“值” text 1 .service = &amp;#34;payment&amp;#34; 这行代码中：.service 是存放数据的位置；= 是赋值；&amp;ldquo;payment&amp;rdquo; 是要放进去的值。
值可以是什么 字符串：&amp;ldquo;payment&amp;rdquo;
整数：200
浮点数：35.7
布尔值：true
空值：null
数组：[]
对象：
text 1 2 3 4 5 6 7 8 9 10 11 { &amp;#34;field1&amp;#34;: .some_path, &amp;#34;field2&amp;#34;: some_variable, &amp;#34;field3&amp;#34;: { &amp;#34;subfield&amp;#34;: &amp;#34;some value&amp;#34; } } { &amp;#34;field1&amp;#34;: &amp;#34;value1&amp;#34;, &amp;#34;field2&amp;#34;: [ &amp;#34;value2&amp;#34;, &amp;#34;value3&amp;#34;, &amp;#34;value4&amp;#34; ], &amp;#34;field3&amp;#34;: { &amp;#34;field4&amp;#34;: &amp;#34;value5&amp;#34; } } Timestamp：
text 1 2 3 4 5 t&amp;#39;2021-02-11T10:32:50.553955473Z&amp;#39; t&amp;#39;2021-02-11T10:32:50.553Z&amp;#39; t&amp;#39;2021-02-11T10:32:50.553-04:00&amp;#39; “字面量” “字面量”可以理解成：“代码里直接写出来的固定值”。</description>
    </item>
  </channel>
</rss>
