dissect

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Integer dataType = iota
	Long
	Float
	Double
	String
	Boolean
	IP
)

List of dataTypes.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dissector

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

Dissector is a tokenizer based on the Dissect syntax as defined at: https://www.elastic.co/guide/en/logstash/current/plugins-filters-dissect.html

func New

func New(tokenizer string) (*Dissector, error)

New creates a new Dissector from a tokenized string.

func (*Dissector) Dissect

func (d *Dissector) Dissect(s string) (Map, error)

Dissect takes the raw string and will use the defined tokenizer to return a map with the extracted keys and their values.

Dissect uses a 3 steps process: - Find the key positions - Extract and resolve the keys (append / indirect) - Ignore namedSkipField

func (*Dissector) DissectConvert

func (d *Dissector) DissectConvert(s string) (MapConverted, error)

func (*Dissector) Raw

func (d *Dissector) Raw() string

Raw returns the raw tokenizer used to generate the actual parser.

type Map

type Map = map[string]string

Map represents the keys and their values extracted with the defined tokenizer.

type MapConverted

type MapConverted = map[string]interface{}

Jump to

Keyboard shortcuts

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