logging

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DocBuilder

type DocBuilder struct {
	fbcontext.ContextAware
}

DocBuilder is a firebolt `node.SyncNode` for building elasticsearch IndexRequests from syslog messages. Because this is a `node.SyncNode`, its 'Process()' method must return immediately. A `node.AsyncNode` interface is also available for async operations such as bulk db writes.

func (*DocBuilder) Process

func (d *DocBuilder) Process(event *firebolt.Event) (*firebolt.Event, error)

Process takes the inbound `msg`, a captainslog.SyslogMsg, and builds a JSON string from it, returning that string as a []byte.

func (*DocBuilder) Receive

func (d *DocBuilder) Receive(msg fbcontext.Message) error

Receive handles a message from another node or an external source. This example doesn't use messaging.

func (*DocBuilder) Setup

func (d *DocBuilder) Setup(config map[string]string) error

Setup ensures that the target Elasticsearch index exists.

func (*DocBuilder) Shutdown

func (d *DocBuilder) Shutdown() error

Shutdown is a no-op in docbuilder. This is where you'd clean up any resources on application shutdown.

type Parser

type Parser struct {
	fbcontext.ContextAware
}

Parser is a firebolt `node.SyncNode` for parsing syslog messages from bytes using `digitalocean/captainslog`. Because this is a `node.SyncNode`, its 'Process()' method must return immediately. A `node.AsyncNode` interface is also available for async operations such as bulk db writes.

func (*Parser) Process

func (p *Parser) Process(event *firebolt.Event) (*firebolt.Event, error)

Process performs whatever work this node does on each event as it arrives. This example takes the inbound `msg`, which is a byte array, and parses a `captainslog.SyslogMsg` from it.

func (*Parser) Receive

func (p *Parser) Receive(msg fbcontext.Message) error

Receive handles a message from another node or an external source. This example doesn't use messaging.

func (*Parser) Setup

func (p *Parser) Setup(config map[string]string) error

Setup is a no-op in parser. This is where you'd do any one-time setup, like establishing a db connection or populating a cache.

func (*Parser) Shutdown

func (p *Parser) Shutdown() error

Shutdown is a no-op in parser. This is where you'd clean up any resources on application shutdown.

Jump to

Keyboard shortcuts

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