首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用splunk连接我的Splunk?

如何使用splunk连接我的Splunk?
EN

Stack Overflow用户
提问于 2018-01-23 15:57:09
回答 1查看 1.1K关注 0票数 0

当尝试使用url时,我得到的URI不能为空

下面是我的代码,

代码语言:javascript
复制
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);

我的密码怎么了?

EN

回答 1

Stack Overflow用户

发布于 2020-11-05 17:03:38

由于您使用的是http而不是https,所以不需要使用HttpService.setSslSecurityProtocol。

相反,将该方案添加到您的ServiceArgs示例: loginArgs.setScheme("http");

不要在传递给setHost的URL中包括http://或https://。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48405893

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档