Hi, When i am using Splunk admin username and password, am able to get the indexes via below code HttpService.setSslSecurityProtocol(SSLSecurityProtocol.TLSv1_2); ServiceArgs loginArgs = new ServiceArgs(); loginArgs.setUsername("USER"); loginArgs.setPassword("PASS"); loginArgs.setHost("HOST"); loginArgs.setPort(8089); loginArgs.setScheme("https"); Service service = Service.connect(loginArgs); System.out.println("printing indexes" + service.getIndexes().values().toString()); But when I am trying to connect with the HEC token created via Splunk Web, I am getting 401 UnAuthorized exception HttpService.setSslSecurityProtocol(SSLSecurityProtocol.TLSv1_2); Service service = new Service("HOST", 8089); service.setToken("xxxxx-xxxx-xxxx-xxxx-xxxxxxxxx"); System.out.println("printing indexes" + service.getIndexes().values().toString()); Am getting below exception Exception in thread "main" com.splunk.HttpException: HTTP 401 -- Unauthorized at com.splunk.HttpException.create(HttpException.java:84) at com.splunk.HttpService.send(HttpService.java:500) at com.splunk.Service.send(Service.java:1295) at com.splunk.HttpService.get(HttpService.java:169) at com.splunk.ResourceCollection.list(ResourceCollection.java:288) at com.splunk.ResourceCollection.refresh(ResourceCollection.java:331) should I use service.setToken("Basic" + "xxxxx-xxxx-xxxx-xxxx-xxxxxxxxx"); or there should be other configuration required to use token?
... View more