<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Not able to run splunk javascript sdk examples. in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Not-able-to-run-splunk-javascript-sdk-examples/m-p/52205#M682</link>
    <description>&lt;P&gt;Yes I was trying the wrong port. Thanks for that. But now I am getting 500 Internal Server Error with response as {"code":"ECONNRESET"}. Do I need to install xml2json app on the splunk server? Where do I get that?&lt;/P&gt;</description>
    <pubDate>Tue, 04 Dec 2012 14:30:21 GMT</pubDate>
    <dc:creator>asingla</dc:creator>
    <dc:date>2012-12-04T14:30:21Z</dc:date>
    <item>
      <title>Not able to run splunk javascript sdk examples.</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Not-able-to-run-splunk-javascript-sdk-examples/m-p/52203#M680</link>
      <description>&lt;P&gt;Setup everything as per the docs, changed the user name and password but when click on Run button on the first example, it says "Error in logging in".&lt;/P&gt;

&lt;P&gt;When checked developer console, it resulted in this error page&lt;/P&gt;

&lt;P&gt;The path '/en-US/services/json/v2/services/auth/login' was not found.&lt;/P&gt;

&lt;P&gt;We have "Splunk 4.3 build 115073." installed. &lt;/P&gt;

&lt;P&gt;Please advice how I should make these examples run.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2012 16:27:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Not-able-to-run-splunk-javascript-sdk-examples/m-p/52203#M680</guid>
      <dc:creator>asingla</dc:creator>
      <dc:date>2012-12-03T16:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to run splunk javascript sdk examples.</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Not-able-to-run-splunk-javascript-sdk-examples/m-p/52204#M681</link>
      <description>&lt;P&gt;A couple of quick questions:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Did you install the xml2json app?&lt;/LI&gt;
&lt;LI&gt;When you gave a port in the examples, did you give it 8089 (or whatever the management port is) or 8000, which is the port you use for the UI? It should be the former.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Tue, 04 Dec 2012 05:41:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Not-able-to-run-splunk-javascript-sdk-examples/m-p/52204#M681</guid>
      <dc:creator>ineeman</dc:creator>
      <dc:date>2012-12-04T05:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to run splunk javascript sdk examples.</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Not-able-to-run-splunk-javascript-sdk-examples/m-p/52205#M682</link>
      <description>&lt;P&gt;Yes I was trying the wrong port. Thanks for that. But now I am getting 500 Internal Server Error with response as {"code":"ECONNRESET"}. Do I need to install xml2json app on the splunk server? Where do I get that?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2012 14:30:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Not-able-to-run-splunk-javascript-sdk-examples/m-p/52205#M682</guid>
      <dc:creator>asingla</dc:creator>
      <dc:date>2012-12-04T14:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to run splunk javascript sdk examples.</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Not-able-to-run-splunk-javascript-sdk-examples/m-p/52206#M683</link>
      <description>&lt;P&gt;The xml2json app is included with the JavaScript SDK, and needs to be copied to your Splunk apps directory. Instructions about setting up this app are here: &lt;BR /&gt;
&lt;A href="http://dev.splunk.com/view/SP-CAAAEFN"&gt;http://dev.splunk.com/view/SP-CAAAEFN&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2012 18:40:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Not-able-to-run-splunk-javascript-sdk-examples/m-p/52206#M683</guid>
      <dc:creator>apruneda_splunk</dc:creator>
      <dc:date>2012-12-04T18:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to run splunk javascript sdk examples.</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Not-able-to-run-splunk-javascript-sdk-examples/m-p/52207#M684</link>
      <description>&lt;P&gt;Done as advised but still the same error. this is how the &lt;BR /&gt;
the X-ProxyDestination in the request header looks like&lt;BR /&gt;
http://&lt;MY_SPLUNK_SERVER_IP&gt;:8089/services/json/v2/services/auth/login?&lt;/MY_SPLUNK_SERVER_IP&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2012 14:54:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Not-able-to-run-splunk-javascript-sdk-examples/m-p/52207#M684</guid>
      <dc:creator>asingla</dc:creator>
      <dc:date>2012-12-05T14:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to run splunk javascript sdk examples.</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Not-able-to-run-splunk-javascript-sdk-examples/m-p/52208#M685</link>
      <description>&lt;P&gt;The javascript sdk examples can only be tested from a webserver. To test them from client, install and use node.js. Try this link "&lt;A href="http://dev.splunk.com/view/SP-CAAAEDC"&gt;http://dev.splunk.com/view/SP-CAAAEDC&lt;/A&gt;"&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2013 01:17:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Not-able-to-run-splunk-javascript-sdk-examples/m-p/52208#M685</guid>
      <dc:creator>chennuri</dc:creator>
      <dc:date>2013-02-14T01:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to run splunk javascript sdk examples.</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Not-able-to-run-splunk-javascript-sdk-examples/m-p/52209#M686</link>
      <description>&lt;P&gt;Make sure you set the port to the management port (8089 by default) rather than the webport (8000, default) as this was my problem when I got that error.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2013 09:23:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Not-able-to-run-splunk-javascript-sdk-examples/m-p/52209#M686</guid>
      <dc:creator>milkmedia</dc:creator>
      <dc:date>2013-02-26T09:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to run splunk javascript sdk examples.</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Not-able-to-run-splunk-javascript-sdk-examples/m-p/52210#M687</link>
      <description>&lt;P&gt;I am not able to login to splunk using javascript sdk. &lt;BR /&gt;
I have done everything as per the document .&lt;BR /&gt;
copied xmljson to splunk apps.&lt;BR /&gt;
Tried mentioning port as 8000 and 8089.&lt;BR /&gt;
installed node.&lt;BR /&gt;
The slient side code is as follows:&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
  &lt;BR /&gt;
    &lt;META charset="utf-8" /&gt;&lt;BR /&gt;
    &lt;TITLE&gt;How to start a Splunk session&lt;/TITLE&gt;&lt;BR /&gt;
    &lt;SCRIPT type="text/javascript" src="C:/Program Files/splunk-sdk/examples/browser/resources/jquery.min.js"&gt;&lt;/SCRIPT&gt;&lt;BR /&gt;
    &lt;SCRIPT type="text/javascript" src="&amp;lt;br&amp;gt;
C:/Program Files/splunk-sdk/client/splunk.js"&gt;&lt;/SCRIPT&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;script type="text/javascript" charset="utf-8"&amp;gt;
function displayApps() {
    var http = new splunkjs.ProxyHttp("/proxy");

    // Create a Service instance and log in 
    var service = new splunkjs.Service(http, {
        username:"admin",
        password:"kav$tim1",
        scheme:"http",
        host:"localhost",
        port:"8089",
        version:"5.0"
    });

   // Verify we logged in


 // First, we log in
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;service.login(function(err, success) {&lt;BR /&gt;
    // We check for both errors in the connection as well&lt;BR /&gt;
    // as if the login itself failed.&lt;BR /&gt;
    if (err || !success) {&lt;BR /&gt;
        console.log("Error in logging in");&lt;BR /&gt;
        done(err || "Login failed");&lt;BR /&gt;
  return;&lt;BR /&gt;
   } &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    // Print installed apps to the console to verify login
    service.apps().fetch(function(err, apps) {
        if (err) {
       console.log("There was an error retrieving the list of applications:", err);
        done(err);
        return;
        }

        var myapps = "";
        var appsList = apps.list();
        console.log("Applications:");
        for(var i = 0; i &amp;lt; appsList.length; i++) {
            myapps += "App " + i + ": " + appsList[i].name + "&amp;lt;br/&amp;gt;"
        } 

        document.getElementById("applist").innerHTML=myapps;
    });

}
&amp;lt;/script&amp;gt; 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;BR /&gt;
&lt;BR /&gt;
    &lt;BUTTON type="button" onclick="displayApps()"&gt;Log in and list apps&lt;/BUTTON&gt;&lt;BR /&gt;
    &lt;/P&gt;&lt;P id="applist"&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Give me a suggestion&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2013 11:46:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Not-able-to-run-splunk-javascript-sdk-examples/m-p/52210#M687</guid>
      <dc:creator>kavyatim</dc:creator>
      <dc:date>2013-03-20T11:46:17Z</dc:date>
    </item>
  </channel>
</rss>

