label

package
v2.0.0-alpha.18 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

README

Label filter plguin

The label filter plugin adds labels to DNSTAP extra field. It can get label value by dnsutils getter functions.

Parameters

Name type Required Default Description
Add []AddLabel no Add settings
Del []DelLabel no Del settings

AddLabel

Name type Required Default Description
Name string yes Label name
Type enum("DNSTAP","DNS","STATIC") yes
Value string yes Type: DNSTAP, Value Type: getter.DnstapGetterName
Type: DNS, Value Type: getter.DnsMsgGetterName
Type: STATIC, Value Type: add this value

DelLabel

Name type Required Default Description
Name string yes Label name

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(raw json.RawMessage) (types.FilterPlugin, error)

Types

type AddLabel

type AddLabel struct {
	Name  string
	Type  AddLabelType
	Value string
	// contains filtered or unexported fields
}

func (*AddLabel) Setup

func (l *AddLabel) Setup() error

type AddLabelType

type AddLabelType string
const (
	AddLabelTypeDNSTAP AddLabelType = "DNSTAP"
	AddLabelTypeDNS    AddLabelType = "DNS"
	AddLabelTypeSTATIC AddLabelType = "STATIC"
)

type DelLabel

type DelLabel struct {
	Name string
}

func (*DelLabel) Validate

func (l *DelLabel) Validate() error

type Label

type Label struct {
	plugin.PluginCommon
	Add []*AddLabel
	Del []*DelLabel
}

func (*Label) Filter

func (f *Label) Filter(t *types.DnstapMessage) *types.DnstapMessage

Jump to

Keyboard shortcuts

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