mask

package
v0.5.18 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: BSD-3-Clause Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Keep fields plugin

Mask plugin matches event with regular expression and substitutions successfully matched symbols via asterix symbol. You could set regular expressions and submatch groups.

Example:

pipelines:
  example_pipeline:
    ...
    actions:
    - type: mask
      metric_subsystem_name: "some_name"
      masks:
      - mask:
        re: "\b(\d{1,4})\D?(\d{1,4})\D?(\d{1,4})\D?(\d{1,4})\b"
        groups: [1,2,3]
    ...
Config params

metric_subsystem_name *string

If set counterMetric with this name would be sent on metric_subsystem_name.mask_plugin.


masks []Mask

List of masks.


mask_applied_field string

If any mask has been applied then mask_applied_field will be set to mask_applied_value in the event.


mask_applied_value string


re string required

Regular expression for masking.


groups []int required

Groups are numbers of masking groups in expression, zero for mask all expression.


max_count int

MaxCount limits the number of masked symbols in the masked output, if zero, no limit is set.


replace_word string

ReplaceWord, if set, is used instead of asterisks for masking patterns that are of the same length or longer.



Generated using insane-doc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	//> @3@4@5@6
	//>
	//> If set counterMetric with this name would be sent on metric_subsystem_name.mask_plugin.
	MetricSubsystemName *string `json:"metric_subsystem_name" required:"false"` //*

	//> @3@4@5@6
	//>
	//> List of masks.
	Masks []Mask `json:"masks"` //*

	//> @3@4@5@6
	//>
	//> If any mask has been applied then `mask_applied_field` will be set to `mask_applied_value` in the event.
	MaskAppliedField string `json:"mask_applied_field"` //*

	//> @3@4@5@6
	//>
	MaskAppliedValue string `json:"mask_applied_value"` //*
}

! config-params ^ config-params

type Mask

type Mask struct {
	//> @3@4@5@6
	//>
	//> Regular expression for masking.
	Re  string `json:"re" default:"" required:"true"` //*
	Re_ *regexp.Regexp

	//> @3@4@5@6
	//>
	//> Groups are numbers of masking groups in expression, zero for mask all expression.
	Groups []int `json:"groups" required:"true"` //*

	//> @3@4@5@6
	//>
	//> MaxCount limits the number of masked symbols in the masked output, if zero, no limit is set.
	MaxCount int `json:"max_count"` //*

	//> @3@4@5@6
	//>
	//> ReplaceWord, if set, is used instead of asterisks for masking patterns that are of the same length or longer.
	ReplaceWord string `json:"replace_word"` //*
}

type Plugin

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

func (*Plugin) Do

func (p *Plugin) Do(event *pipeline.Event) pipeline.ActionResult

func (*Plugin) Start

func (p *Plugin) Start(config pipeline.AnyConfig, params *pipeline.ActionPluginParams)

func (*Plugin) Stop

func (p *Plugin) Stop()

Jump to

Keyboard shortcuts

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