vertoforce / go-splunk

Splunk enterprise API go library
1 stars 1 forks source link
hacktoberfest splunk splunk-enterprise-api

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

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)