Syslog5424Reader

文档中心 › 组件索引 › Syslog5424Reader

Syslog5424Reader Controller Service

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

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

描述

提供一种机制,用于读取符合 RFC 5424 的 Syslog 数据(例如日志文件)并构建数据以便对其进行处理。

标签

syslog 5424sysloglogslogfilesparsetextrecordreader

属性

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

名称默认值可选值描述
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)

详细说明

Syslog5424Reader

Syslog5424Reader Controller Service 提供了一种解析合法的 RFC 5424 Syslog 消息的手段。 该服务生成的记录使用固定 schema,以匹配规范要求。

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

Schema

从传入数据解析记录时,记录会被解析为 RFC 5424 schema。

RFC 5424 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",
        {
          "type": "long",
          "logicalType": "timestamp-millis"
        }
      ]
    },
    {
      "name": "hostname",
      "type": [
        "null",
        "string"
      ]
    },
    {
      "name": "body",
      "type": [
        "null",
        "string"
      ]
    },
    {
      "name": "appName",
      "type": [
        "null",
        "string"
      ]
    },
    {
      "name": "procid",
      "type": [
        "null",
        "string"
      ]
    },
    {
      "name": "messageid",
      "type": [
        "null",
        "string"
      ]
    },
    {
      "name": "structuredData",
      "type": [
        "null",
        {
          "type": "map",
          "values": {
            "type": "map",
            "values": "string"
          }
        }
      ]
    }
  ]
}