Did you ever solve this problem. It looks like it is a very common problem which I have run into myself. None of the suggestions have worked for me. My code: com.splunk.HttpService.setSslSecurityProtocol(com.splunk.SSLSecurityProtocol.TLSv1_2); ServiceArgs loginArgs = new ServiceArgs(); loginArgs.setToken("Splunk 2f8c48b2-aa3b-466f-9c08-xxxxxxxxxxxx"); loginArgs.setHost("splunk-hec.mydomain.com"); loginArgs.setPort(8088); loginArgs.setScheme("https"); Service splunkService = Service.connect(loginArgs); System.out.println("printing indexes" + splunkService.getIndexes().values().toString()); Gives: Exception in thread "main" com.splunk.HttpException: HTTP 404 -- {"text":"The requested URL was not found on this server.","code":404} Note this works fine from cURL such as: curl -H "Authorization: Splunk 2f8c48b2-aa3b-466f-9c08-xxxxxxxxxxxx" \ -H "X-Splunk-Request-Channel: bc805b0d-0151-4c6c-96dc-xxxxxxxxxxxx" \ https://splunk-hec.mydomain.com:8088/services/collector/event \ -d '{"sourcetype": "_json", "event": { "fieldA" : "valueA", "fieldB" : "valueB" } }' One potential difference is the request channel which I have to include with cURL due to acknowledgement being turned on. I'm not sure how to provide that here but really would expect a different error if that was the problem. Also my code works fine using username and password to as local Splunk instance I have.
... View more