logstash

package module
v0.0.0-...-85506bb Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2014 License: MIT Imports: 4 Imported by: 4

README

go-logstash

A golang package that sends newline delimited data via tcp to logstash.

Example

import(
	"github.com/heatxsink/go-logstash"
	"fmt"
)

func main() {
	l := logstash.New("127.0.0.1", 9000, 5)
	_, err := l.Connect()
	if err != nil {
		fmt.Println(err)
	}
	err = l.Writeln("{ 'foo' : 'bar' }")
	if err != nil {
		fmt.Println(err)
	}
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logstash

type Logstash struct {
	Hostname   string
	Port       int
	Connection *net.TCPConn
	Timeout    int
}

func New

func New(hostname string, port int, timeout int) *Logstash

func (*Logstash) Connect

func (l *Logstash) Connect() (*net.TCPConn, error)

func (*Logstash) Dump

func (l *Logstash) Dump()

func (*Logstash) SetTimeouts

func (l *Logstash) SetTimeouts()

func (*Logstash) Writeln

func (l *Logstash) Writeln(message string) error

Jump to

Keyboard shortcuts

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