# README
Splunk HEC Golang Library
Golang library for Splunk HTTP Event Collector (HEC).
Build
You need install glide before build.
Install all dependencies
glide install
Build the example
go build -o build/example ./example/main.go
Features
- Support HEC JSON mode and Raw mode
- Send batch of events
- Customize retrying times
- Cut big batch into chunk less than MaxContentLength
- Indexer acknowledgement
- Streaming data via HEC Raw
Example
client := hec.NewCluster(
[]string{"https://127.0.0.1:8088", "https://localhost:8088"},
"00000000-0000-0000-0000-000000000000",
)
client.SetHTTPClient(&http.Client{Transport: &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}})
event1 := hec.NewEvent("event one")
event1.SetTime(time.Now())
event2 := hec.NewEvent("event two")
event2.SetTime(time.Now().Add(-time.Minute))
err := client.WriteBatch([]*hec.Event{event1, event2})
if err != nil {
log.Fatal(err)
}
See hec.go
for more usages.
# Packages
No description provided by the author
# Functions
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Constants
Response status codes.
Response status codes.
Response status codes.
Response status codes.
Response status codes.
Response status codes.
Response status codes.
Response status codes.
Response status codes.
Response status codes.
Response status codes.
Response status codes.
Response status codes.
Response status codes.
Response status codes.
# Variables
No description provided by the author
# Structs
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Response is response message from HEC.
# Interfaces
No description provided by the author