0
        try { 
            url = new URL(splunkUrl);
            connection = (HttpsURLConnection)url.openConnection();
 
            //make POST request 
            connection.setRequestMethod("POST");
            if (!authToken.equals("")) {
                connection.setRequestProperty("Authorization",
                        "Splunk " + authToken);
            } 
            connection.setDoOutput(true);
 
            //no caching, no user interaction, no redirects 
            connection.setUseCaches(false);
            connection.setAllowUserInteraction(false);
            connection.setInstanceFollowRedirects(false);
 
            //POST to the login endpoint 
            outputstreamwriter = new OutputStreamWriter(
                    connection.getOutputStream(), "UTF-8");
            outputstreamwriter.write(dataInput);
            outputstreamwriter.flush();
 
        } catch (ProtocolException e) {
            e.printStackTrace();