netflow

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package netflow is a domain for network observability flow events stored in Loki or LokiStack.

Class

There is a single class `netflow:network`

Object

A log object is a JSON `map[string]any` in NetFlow format.

Query

A query is a LogQL query string, prefixed by `netflow:network:`, for example:

netflow:network:{SrcK8S_Type="Pod", SrcK8S_Namespace="myNamespace"}

Store

To connect to a netflow lokiStack store use this configuration:

domain: netflow
lokistack: URL_OF_LOKISTACK_PROXY

To connect to plain loki store use:

domain: netflow
loki: URL_OF_LOKI

Index

Constants

View Source
const (
	StoreKeyLoki      = "loki"
	StoreKeyLokiStack = "lokiStack"
)

Variables

View Source
var Domain = domain{}

Domain for log records produced by openshift-logging.

There are several possible log store configurations: - Default LokiStack store on current Openshift cluster: `{}` - Remote LokiStack: `{ "lokiStack": "https://url-of-lokistack"}` - Plain Loki store: `{ "loki": "https://url-of-loki"}`

Functions

func NewLokiStackStore

func NewLokiStackStore(base *url.URL, h *http.Client) (korrel8r.Store, error)

NewLokiStackStore returns a store that uses a LokiStack observatorium-style URLs.

func NewPlainLokiStore

func NewPlainLokiStore(base *url.URL, h *http.Client) (korrel8r.Store, error)

NewPlainLokiStore returns a store that uses plain Loki URLs.

func NewQuery

func NewQuery(logQL string) korrel8r.Query

func Preview

func Preview(x korrel8r.Object) (line string)

Preview extracts the message from a Viaq log record.

Types

type Class

type Class struct{}

There is only a single class, named "netflow ".

func (Class) Description

func (c Class) Description() string

func (Class) Domain

func (c Class) Domain() korrel8r.Domain

func (Class) Name

func (c Class) Name() string

func (Class) New

func (c Class) New() korrel8r.Object

func (Class) Preview

func (c Class) Preview(x korrel8r.Object) (line string)

Preview extracts the message from a Viaq log record.

func (Class) String

func (c Class) String() string

type Object

type Object map[string]any

Object is a map holding netflow entries

func NewObject

func NewObject(entry *loki.Entry) Object

func (*Object) UnmarshalJSON

func (o *Object) UnmarshalJSON(line []byte) error

type Query

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

Query is a LogQL query string

func (Query) Class

func (q Query) Class() korrel8r.Class

func (Query) Data added in v0.6.0

func (q Query) Data() string

func (Query) String

func (q Query) String() string

Jump to

Keyboard shortcuts

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