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
- Create Search Job
- Find Search Job
- Wait on Search Job
- Get Results from Search Job
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)