splunk

package module
v0.0.0-...-ae36d4e Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeSender

func MakeSender(info ConnectionInfo) (send.Sender, error)

MakeSender constructs a new Sender implementation that sends messages to a Splunk event collector using the credentials specified in the SplunkConnectionInfo struct.

func MakeSenderWithClient

func MakeSenderWithClient(info ConnectionInfo, client *http.Client) (send.Sender, error)

MakeSenderWithClient makes it possible to pass an existing http.Client to the splunk instance, but is otherwise identical to MakeSender.

Types

type ConnectionInfo

type ConnectionInfo struct {
	ServerURL string `bson:"url" json:"url" yaml:"url"`
	Token     string `bson:"token" json:"token" yaml:"token"`
	Channel   string `bson:"channel" json:"channel" yaml:"channel"`
}

ConnectionInfo stores all information needed to connect to a splunk server to send log messsages.

func GetConnectionInfo

func GetConnectionInfo() ConnectionInfo

GetConnectionInfo builds a SplunkConnectionInfo structure reading default values from the following environment variables:

GRIP_SPLUNK_SERVER_URL
GRIP_SPLUNK_CLIENT_TOKEN
GRIP_SPLUNK_CHANNEL

func (ConnectionInfo) Populated

func (info ConnectionInfo) Populated() bool

Populated validates a SplunkConnectionInfo, and returns false if there is missing data.

Jump to

Keyboard shortcuts

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