SyslogReader

文档中心 › 组件索引 › SyslogReader

SyslogReader Controller Service

类型全限定名:cn.org.acal.lynxus.syslog.SyslogReader

所属 Bundle:cn.org.acal.lynxus:lynxus-record-serialization-services-nar:2.11.8

描述

尝试根据 RFC5424 和 RFC3164 解析 Syslog 消息的内容。 对于 RFC5424 格式的消息,不支持结构化数据,并将作为消息的一部分返回。注意:请注意,RFC3164 是信息性的,并且存在多种不同的实现。

标签

sysloglogslogfilesparsetextrecordreader

属性

下表中,加粗的属性为必填项;其余为可选项。表格同时标注默认值、是否支持表达式语言,以及是否为敏感属性(值会被加密)。

名称默认值可选值描述
Character SetUTF-8指定 Syslog 消息的字符集
原始消息false
  • true
  • false
如果为 true,记录将包含一个 _raw 字段,其中包含原始消息

状态管理

该组件不存储状态。

受限 (Restricted)

该组件不受限。

提供的 Service API

  • RecordReaderFactory (cn.org.acal.lynxus-lynxus-standard-services-api-nar-2.11.8)

详细说明

SyslogReader

SyslogReader Controller Service 提供了一种解析 Syslog 消息内容的手段, 兼容 RFC5424 和 RFC3164 格式。该 Reader 生成的记录使用固定 schema, 以匹配两个规范中的公共字段集合。

该服务的必需属性名为 Character Set,用于指定传入文本的字符集。

Schema

从传入数据解析记录时,记录会被解析为通用 Syslog Schema(Generic Syslog Schema)。

通用 Syslog Schema

{
  "type": "record",
  "name": "lynxusRecord",
  "namespace": "cn.org.acal.lynxus",
  "fields": [
    {
      "name": "priority",
      "type": [
        "null",
        "string"
      ]
    },
    {
      "name": "severity",
      "type": [
        "null",
        "string"
      ]
    },
    {
      "name": "facility",
      "type": [
        "null",
        "string"
      ]
    },
    {
      "name": "version",
      "type": [
        "null",
        "string"
      ]
    },
    {
      "name": "timestamp",
      "type": [
        "null",
        "string"
      ]
    },
    {
      "name": "hostname",
      "type": [
        "null",
        "string"
      ]
    },
    {
      "name": "body",
      "type": [
        "null",
        "string"
      ]
    }
  ]
}