protocol_mail

package
v0.0.0-...-8c0ad1a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

README

protocol_mail

protocol_mail processor 根据raw_mail解析详细邮件内容,并提取字段放入 event 中。

如何使用?

将此 processor 添加到 filebeat 后,你可以在 filebeat processors 配置段中增加以下配置:

processors:
  - protocol_mail:
      # 源字段,protocol_mail processor 从此字段读取到一个文件名,然后按照分隔符提取前缀
      # 此配置默认值为 "raw_mail"
      source_field: "raw_mail
      # processor 标记位,protocol_mail processor 处理成功后会将此字段设置为 true
      # 通常该字段用于标识作用,方便后面的 logstash 判断 event 是否被某个 processor 处理过
      # 此配置默认值为 "processors.protocol_mail"
      processors_field: "processors.protocol_mail"

如何调试?

你可以为 logstash 开启终端输出来实时观察日志处理情况:

output {
  stdout {
    codec => rubydebug
  }
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg *common.Config) (processors.Processor, error)

New constructs a new protocol_mail processor.

Types

type ProtocolMail

type ProtocolMail struct {
	// contains filtered or unexported fields
}

func (*ProtocolMail) Run

func (p *ProtocolMail) Run(event *beat.Event) (*beat.Event, error)

func (*ProtocolMail) String

func (p *ProtocolMail) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL