splunk

package
v0.0.0-...-6d4bf48 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2023 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package splunk sends log data to a splunk server.

Index

Constants

View Source
const (
	// DialTimeout limits how long a write will block
	// while dialing the splunk server. Assuming the
	// connection stays open for a long time, this will
	// happen only rarely.
	DialTimeout = 50 * time.Millisecond

	// WriteTimeout limits how long a write will block
	// sending data on the network. It is deliberately
	// very small, so that writes can only be satisfied
	// by the local network buffers. It should never
	// block waiting for a TCP ACK for an appreciable
	// amount of time.
	WriteTimeout = 100 * time.Microsecond
)

Variables

This section is empty.

Functions

func New

func New(addr string, dropmsg []byte) io.Writer

New creates a new writer that sends data to the given TCP address. It connects on the first call to Write, and attempts to reconnect when necessary, with a timeout of DialTimeout.

Every write has a timeout of WriteTimeout. If the write doesn't complete in that time, the writer drops the unwritten data. For every contiguous run of dropped data, it writes dropmsg before resuming ordinary writes. As long as the remote endpoint can keep up with the averate data rate and the local network buffers in the kernel and NIC are big enough to hold traffic bursts, no data will be lost.

Types

This section is empty.

Jump to

Keyboard shortcuts

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