return Service.connect(serviceArgs);
/** * Create connection with the splunk server. */ @Override public void connect() { try { ServiceArgs loginArgs = new ServiceArgs(); loginArgs.setUsername(userName); loginArgs.setPassword(password); loginArgs.setHost(host); loginArgs.setPort(port); service = Service.connect(loginArgs); } catch (Exception e) { throw new RuntimeException("closing connection", e); } }
/** * Create connection with the splunk server. */ @Override public void connect() { try{ ServiceArgs loginArgs = new ServiceArgs(); loginArgs.setUsername(userName); loginArgs.setPassword(password); loginArgs.setHost(host); loginArgs.setPort(port); service = Service.connect(loginArgs); } catch(Exception e){ throw new RuntimeException("closing connection", e); } }
public void initialize(ThunderProperties properties) throws Exception { this.properties = properties; if (service == null) { try { ServiceArgs loginArgs = new ServiceArgs(); loginArgs.setHost(properties.getString(ThunderConstant.SPLUNK_HOST_ATTRIBUTE_NAME)); loginArgs.setPort(properties.getInteger(ThunderConstant.SPLUNK_PORT_ATTRIBUTE_NAME)); loginArgs.setUsername(properties.getString(ThunderConstant.SPLUNK_USER_NAME_ATTRIBUTE_NAME)); loginArgs.setPassword(properties.getString(ThunderConstant.SPLUNK_PASSWORD_ATTRIBUTE_NAME)); loginArgs.setSSLSecurityProtocol(SSLSecurityProtocol.TLSv1_2); service = Service.connect(loginArgs); } catch (Exception e) { LOG.error("Initialize Splunk connection failed", e); dispose(); } } }