hash

package
v0.0.0-...-c66a2f6 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: MIT Imports: 15 Imported by: 0

README

hash

This filter generates a hash out of your source fields and stores the hash in a target field.

filter:
  - type: hash
    # (optional) source fields, default is [message]
    source: ["message"]
    # (optional) field to store the hash, default is hash
    target: hash
    # (optional) what kind of hash to create, default is sha1 - see list below
    kind: sha1
    # (optional) output format for hash, default is hex
    format: hex

Supported hash formats (kind)

  • adler32
  • md5
  • sha1
  • sha256
  • fnv32a
  • fnv128a

Supported output formats (format)

  • base64
  • binary
  • int
  • hex

Documentation

Index

Constants

View Source
const ModuleName = "hash"

ModuleName is the name used in the config file

Variables

This section is empty.

Functions

func InitHandler

func InitHandler(
	ctx context.Context,
	raw config.ConfigRaw,
	control config.Control,
) (config.TypeFilterConfig, error)

InitHandler initialize the filter plugin

Types

type FilterConfig

type FilterConfig struct {
	config.FilterConfig
	Source []string `json:"source" yaml:"source"` // source message field name(s)
	Target string   `json:"target" yaml:"target"` // target field where the hash should be stored
	Kind   string   `json:"kind" yaml:"kind"`     // kind of hash
	Format string   `json:"format" yaml:"format"` // output format
	// contains filtered or unexported fields
}

FilterConfig holds the configuration json fields and internal objects

func DefaultFilterConfig

func DefaultFilterConfig() FilterConfig

DefaultFilterConfig returns an FilterConfig struct with default values

func (*FilterConfig) Event

Event is the main filter event

Jump to

Keyboard shortcuts

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