csv

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 9 Imported by: 2

README

Example CLI usage (from honeytail root)

honeytail -p csv -k $HONEYTAIL_WRITEKEY \
  -f some/path/system.log \
  --dataset 'MY_TEST_DATASET' \
  --backfill \
  --csv.fields="time,field_1,field_2,field_3"
  --csv.timefield="time" \
  --csv.time_format="%H:%M:%S"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSVLineParser

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

func NewCSVLineParser

func NewCSVLineParser(fieldsString string, trimLeadingSpace bool) (*CSVLineParser, error)

NewCSVLineParser factory

func (*CSVLineParser) ParseLine

func (p *CSVLineParser) ParseLine(line string) (map[string]interface{}, error)

type Options

type Options struct {
	Fields           string `long:"fields" description:"Comma separated list of CSV fields, in order."`
	TimeFieldName    string `long:"timefield" description:"Name of the field that contains a timestamp" yaml:"timefield,omitempty"`
	TimeFieldFormat  string `` /* 128-byte string literal not displayed */
	TrimLeadingSpace bool   `long:"trim_leading_space" description:"trim leading whitespace in CSV fields and values" yaml:"trim_leading_space,omitempty"`

	NumParsers int `hidden:"true" description:"number of csv parsers to spin up" yaml:"-"`
}

Options defines the options relevant to the CSV parser

type Parser

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

Parser implements the Parser interface

func (*Parser) Init

func (p *Parser) Init(options interface{}) error

Init constructs our parser from the provided options

func (*Parser) ProcessLines

func (p *Parser) ProcessLines(lines <-chan string, send chan<- event.Event, prefixRegex *parsers.ExtRegexp)

Jump to

Keyboard shortcuts

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