/go-splunk

Splunk enterprise API go library

Primary LanguageGo

Splunk Enterprise API Go Library

Go Report Card Documentation

Go library to interact with the splunk enterprise API

I did not implement each API call, but I made a helper to make it easy to call any other endpoint

Implemented

  • Create Search Job
  • Find Search Job
  • Wait on Search Job
  • Get Results from Search Job

Custom API Call

If you want to make your own API call (that isn't implemented as a function), do the following:

// Create the client
client, _ := splunk.NewClient(ctx, username, password, baseURL)

// Make your own custom request
resp, _ := client.BuildResponse(ctx, "GET", "/saved/searches/{name}/history", map[string]string{"savedsearch": "nameOfSearch"})

// Parse the result
result := YourStruct{}
json.NewDecoder(resp.Body).Decode(&result)