rename

package
v1.8.8 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

README

字段重命名

该插件可对指定的字段(支持多个)进行重命名。

参数说明

插件类型(type)为 processor_rename

参数 类型 必选或可选 参数说明
NoKeyError bool 可选 无匹配的key是否记录,默认false。
SourceKeys array 必选 指定要从日志中重命名的源key(多个),字符串数组。
DestKeys array 必选 指定要从日志中重命名的目标key(多个),字符串数组。
示例

将字段 aaa1aaa2 重命名为 bbb1bbb2,配置详情及处理结果如下:

  • 输入
"aaa1":"value1"
"aaa2":"value2"
"aaa3":"value3"
  • 配置详情
{
  "processors":[
    {
      "type":"processor_rename",
      "detail": {
        "SourceKeys": ["aaa1","aaa2"],
        "DestKeys": ["bbb1","bbb2"],
        "NoKeyError": true
      }
    }
  ]
}
  • 配置后结果
"bbb1":"value1"
"bbb2":"value2"
"aaa3":"value3"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProcessorRename

type ProcessorRename struct {
	NoKeyError bool
	SourceKeys []string
	DestKeys   []string
	// contains filtered or unexported fields
}

func (*ProcessorRename) Description

func (*ProcessorRename) Description() string

func (*ProcessorRename) Init

func (p *ProcessorRename) Init(context pipeline.Context) error

Init called for init some system resources, like socket, mutex...

func (*ProcessorRename) Process added in v1.4.0

func (*ProcessorRename) ProcessLogs

func (p *ProcessorRename) ProcessLogs(logArray []*protocol.Log) []*protocol.Log

Jump to

Keyboard shortcuts

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