🏷️ 标签(1)

🗂️ 分类(1)

4.4 字段规范化

4.4 字段规范化

为什么要规范化

字段标准化是可检索性与可视化的关键。如果每个团队使用不同字段名,会导致搜索与仪表盘不可复用。

常见规范

  • IPclient_ip

  • 方法http_method

  • 路径request_path

  • 状态码http_status

  • 耗时request_time

  • 服务名service

  • 环境env

建议策略

  1. 建立 字段字典(Field Dictionary)

  2. 在 Pipelines 中统一命名

  3. 对关键字段设置类型(long/double/string)

示例规则

rule "normalize_http"
when
  has_field("method")
then
  set_field("http_method", to_string($message.method));
  set_field("request_path", to_string($message.path));
end

小结

字段规范化是长期收益最高的工作。下一章进入搜索语法。


下一节5.1 查询语法

返回目录 | 返回首页