Go-Splunk-HTTP
Go-Splunk-HTTP copied to clipboard
http connection not closing properly
If you are moving a high volume of messages to splunk, the doRequest (splunk/splunk.go) function is not properly closing the http request and you quickly run out of file descriptors. The code below should be added before each of the returns on lines 164 and 173. It's better not to use the "defer" as this also waits longer than necessary to close the connection.
if res != nil {
res.Body.Close()
}