csv

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

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"`
	TimeFieldFormat  string `long:"time_format" description:"Timestamp format to use (strftime and Golang time.Parse supported)"`
	NumParsers       int    `hidden:"true" description:"number of csv parsers to spin up"`
	TrimLeadingSpace bool   `bool:"trim_leading_space" description:"trim leading whitespace in CSV fields and values" default:"false"`
}

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