htjson

package
v0.0.0-...-b962a07 Latest Latest
Warning

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

Go to latest
Published: May 2, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package htjson (honeytail-json, renamed to not conflict with the json module) parses logs that are one json blob per line.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONLineParser

type JSONLineParser struct {
}

func (*JSONLineParser) ParseLine

func (j *JSONLineParser) ParseLine(line string) (map[string]interface{}, error)

ParseLine will unmarshal the thing it read in to detect errors in the JSON (by failing to parse) and give us an object that can be mutated by the various filters honeytail might apply.

type Options

type Options struct {
	TimeFieldName   string `long:"timefield" description:"Name of the field that contains a timestamp"`
	TimeFieldFormat string `long:"format" description:"Format of the timestamp found in timefield (supports strftime and Golang time formats)"`

	NumParsers int `hidden:"true" description:"number of htjson parsers to spin up"`
}

type Parser

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

func (*Parser) Init

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

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