You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Draft code which can get a long xml but without the log sent by e2e tests. Need to investigate how to search the results. Opened the issue in splunk repo: splunk/docker-splunk#625
func validateTestLogsInSplunk(url string, token string, testLog string) {
// Use REST API to retrieve the logs. https://docs.splunk.com/Documentation/Splunk/9.1.1/RESTREF/RESTsearch#search.2Fjobs
tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
client := &http.Client{Transport: tr}
searchQuery := "search *" // Get the latest of all the log events.
req, err := http.NewRequest("POST", fmt.Sprintf("%s/services/search/jobs", url), bytes.NewBufferString(searchQuery))
gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
req.Header.Set("Authorization", fmt.Sprintf("Splunk %s", token)) // https://docs.splunk.com/Documentation/Splunk/9.1.1/Security/UseAuthTokens
resp, err := client.Do(req)
gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
fmt.Println(string(body))
}
The text was updated successfully, but these errors were encountered:
*Description of changes:*
The test is not perfect but can be used for basic validation because the
containerd task is ran successfully with the Splunk shim logger. It is
nice to validate the logs in Splunk after it. It is not straightforward
to do that so opened issue to track it.
#74
By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
Signed-off-by: Ziwen Ning <[email protected]>
Draft code which can get a long xml but without the log sent by e2e tests. Need to investigate how to search the results. Opened the issue in splunk repo: splunk/docker-splunk#625
The text was updated successfully, but these errors were encountered: