Regenerate the token on 401 and verify the role's search capability on 403 before touching your code. Wait for ingestion and double-check the index name when searches come back empty. Confirm network access to the management port and that the URL includes the protocol and port when the connection itself fails.

Context: An integration troubleshooting guide documents the common Splunk failure modes. HTTP 401 Unauthorized means the token expired or was generated with the wrong account; regenerate it. HTTP 403 Forbidden means the token lacks the search capability, so check the role assigned to the token. Empty search results usually mean data was not ingested yet or the index name is wrong. A connection refused on port 8089 points at the Splunk management port being firewalled rather than a credential problem.