outputloki

package
v0.0.0-...-c13075e Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 14 Imported by: 0

README

gogstash output email

Synopsis

{
    "output": [
        {
            "type": "loki",

            // (required)
            "urls": ["http://192.168.1.11:3100/loki/api/v1/push"],

            // (optional)
            "auth": "loki_account:loki_passwd",
        }
    ]
}

Documentation

Index

Constants

View Source
const ModuleName = "loki"

ModuleName is the name used in config file

Variables

View Source
var (
	ErrNoValidURLs = errutil.NewFactory("no valid URLs found")
)

errors

Functions

func InitHandler

func InitHandler(
	ctx context.Context,
	raw config.ConfigRaw,
	control config.Control,
) (config.TypeOutputConfig, error)

InitHandler initialize the output plugin

func ToStringE

func ToStringE(i any) (string, error)

ToStringE casts an empty interface to a string.

Types

type LokiRequest

type LokiRequest struct {
	Streams []LokiStream `json:"streams"`
}

type LokiStream

type LokiStream struct {
	Stream map[string]any `json:"stream"`
	Values []LokiValue    `json:"values"`
}

type LokiValue

type LokiValue [2]string

type OutputConfig

type OutputConfig struct {
	config.OutputConfig
	URLs []string `json:"urls"` // Array of HTTP connection strings
	Auth string   `json:"auth"`
	// contains filtered or unexported fields
}

OutputConfig holds the configuration json fields and internal objects

func DefaultOutputConfig

func DefaultOutputConfig() OutputConfig

DefaultOutputConfig returns an OutputConfig struct with default values

func (*OutputConfig) Output

func (t *OutputConfig) Output(ctx context.Context, event logevent.LogEvent) (err error)

Output event

Jump to

Keyboard shortcuts

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