【发布时间】:2018-01-23 15:57:09
【问题描述】:
在尝试使用 url 时,我得到 URI 不能为空
下面是我的代码,
HttpService.setSslSecurityProtocol(SSLSecurityProtocol.SSLv3);
//Tried the below one also
//HttpService.setSslSecurityProtocol(SSLSecurityProtocol.TLSv1_2);
ServiceArgs loginArgs = new ServiceArgs();
loginArgs.setUsername("username");
loginArgs.setPassword("password");
loginArgs.setHost("my splunk url"); //for eg http://splunkdet.mysite.com:8000/login
loginArgs.setPort(8000);
Service service = Service.connect(loginArgs);
for (Application app: service.getApplications().values()) {
System.out.println(app.getName());
}
获取异常“URI 不能为空”Service service = Service.connect(loginArgs);
我的代码有什么问题?
【问题讨论】:
-
主机应该只是一个主机,而不是一个 HTTP 端点。特别是因为您在以下行设置端口
标签: java splunk splunk-query splunk-formula splunk-sdk