<?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: Why am I getting a 404 error trying to connect to Splunk Enterprise using the JavaScript SDK? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-am-I-getting-a-404-error-trying-to-connect-to-Splunk/m-p/209679#M13116</link>
    <description>&lt;P&gt;Hi @jameskerivan,&lt;BR /&gt;
I'm not sure of all the details of your situation, but did you make sure to start splunkd (Splunk server) before running this code?&lt;BR /&gt;
See this resource in our documentation:&lt;BR /&gt;
&lt;A href="http://dev.splunk.com/view/javascript-sdk/SP-CAAAEC9"&gt;http://dev.splunk.com/view/javascript-sdk/SP-CAAAEC9&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I hope this helps! If not, we can continue troubleshooting.&lt;BR /&gt;
Best,&lt;BR /&gt;
@frobinson_splunk&lt;/P&gt;</description>
    <pubDate>Thu, 10 Sep 2015 23:58:18 GMT</pubDate>
    <dc:creator>frobinson_splun</dc:creator>
    <dc:date>2015-09-10T23:58:18Z</dc:date>
    <item>
      <title>Why am I getting a 404 error trying to connect to Splunk Enterprise using the JavaScript SDK?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-am-I-getting-a-404-error-trying-to-connect-to-Splunk/m-p/209678#M13115</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;

&lt;P&gt;I was building a dashboard for my company and needed to get Splunk information.  Right now, I use the JavaScript SDK like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$(document).ready(function() {
    $('#searchButton').on('click', displayApps);
});

function displayApps(event) {
        var http = new splunkjs.ProxyHttp("/proxy");

    // Create a Service instance and log in 
    var service = new splunkjs.Service(http, {
        username:"username",
        password:"password",
        scheme:"https",
        host:"hostname.com",
        port:"correctport#",
        version:"5.0"
    });

    // Verify we logged in
    // Print installed apps to the console to verify login
    service.apps().fetch(function(err, apps) {
        if (err) {
            console.log(err);
            return;
        }

        var myapps = "";
        var appsList = apps.list();
        for(var i = 0; i &amp;lt; appsList.length; i++) {
        } 
    }); 

}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The thing is, I am getting a 404 error.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;POST &lt;A href="http://localhost:3000/proxy/services/auth/login?output_mode=json" target="test_blank"&gt;http://localhost:3000/proxy/services/auth/login?output_mode=json&lt;/A&gt; 404 (Not Found)  jquery.min.js:4 

Object {response: Object, status: 404, data: "&amp;lt;!DOCTYPE html&amp;gt;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;&amp;lt;link re…ss\lib\router\index.js:46:12)&amp;lt;/pre&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;", error: "Not Found"}  splunkSession.js:23
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I apologize as I am new to web dev, so I am trying to hack this together as best as I can.  &lt;/P&gt;

&lt;P&gt;Thanks again&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2015 22:21:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-am-I-getting-a-404-error-trying-to-connect-to-Splunk/m-p/209678#M13115</guid>
      <dc:creator>jameskerivan</dc:creator>
      <dc:date>2015-09-10T22:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting a 404 error trying to connect to Splunk Enterprise using the JavaScript SDK?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-am-I-getting-a-404-error-trying-to-connect-to-Splunk/m-p/209679#M13116</link>
      <description>&lt;P&gt;Hi @jameskerivan,&lt;BR /&gt;
I'm not sure of all the details of your situation, but did you make sure to start splunkd (Splunk server) before running this code?&lt;BR /&gt;
See this resource in our documentation:&lt;BR /&gt;
&lt;A href="http://dev.splunk.com/view/javascript-sdk/SP-CAAAEC9"&gt;http://dev.splunk.com/view/javascript-sdk/SP-CAAAEC9&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I hope this helps! If not, we can continue troubleshooting.&lt;BR /&gt;
Best,&lt;BR /&gt;
@frobinson_splunk&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2015 23:58:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-am-I-getting-a-404-error-trying-to-connect-to-Splunk/m-p/209679#M13116</guid>
      <dc:creator>frobinson_splun</dc:creator>
      <dc:date>2015-09-10T23:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting a 404 error trying to connect to Splunk Enterprise using the JavaScript SDK?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-am-I-getting-a-404-error-trying-to-connect-to-Splunk/m-p/209680#M13117</link>
      <description>&lt;P&gt;My company has the splunk server running at the hostname.  I have double checked the hostname and port#.  My credentials allow me to login through the UI so I assume they are correct.  I have tried different schemes, but nothing so far.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2015 17:32:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-am-I-getting-a-404-error-trying-to-connect-to-Splunk/m-p/209680#M13117</guid>
      <dc:creator>jameskerivan</dc:creator>
      <dc:date>2015-09-11T17:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting a 404 error trying to connect to Splunk Enterprise using the JavaScript SDK?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-am-I-getting-a-404-error-trying-to-connect-to-Splunk/m-p/209681#M13118</link>
      <description>&lt;P&gt;Ok, on taking a look for other answers posts that seem related, it sounds like double-checking the server configurations regarding the proxy might be helpful. See these previous posts:&lt;BR /&gt;
&lt;A href="http://answers.splunk.com/answers/71756/starting-with-javascript-sdk.html"&gt;http://answers.splunk.com/answers/71756/starting-with-javascript-sdk.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://answers.splunk.com/answers/55188/sdk-javascript-client-side-test-error-404.html"&gt;http://answers.splunk.com/answers/55188/sdk-javascript-client-side-test-error-404.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Again, let me know if this does not help. Other folks might chime in here too &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;All best,&lt;BR /&gt;
@frobinson_splunk&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2015 19:48:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-am-I-getting-a-404-error-trying-to-connect-to-Splunk/m-p/209681#M13118</guid>
      <dc:creator>frobinson_splun</dc:creator>
      <dc:date>2015-09-11T19:48:39Z</dc:date>
    </item>
  </channel>
</rss>

