<?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: Can´t connect to splunk in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Can-t-connect-to-splunk/m-p/101209#M1470</link>
    <description>&lt;P&gt;Edit Error: &lt;BR /&gt;
 &lt;A href="https://localhost:8000/en-US/proxy/services/auth/login?output_mode=json"&gt;https://localhost:8000/en-US/proxy/services/auth/login?output_mode=json&lt;/A&gt; 404 (Not Found)&lt;/P&gt;</description>
    <pubDate>Sat, 26 Jan 2013 20:12:18 GMT</pubDate>
    <dc:creator>splunkjunkxx</dc:creator>
    <dc:date>2013-01-26T20:12:18Z</dc:date>
    <item>
      <title>Can´t connect to splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Can-t-connect-to-splunk/m-p/101208#M1469</link>
      <description>&lt;P&gt;Hi guys&lt;/P&gt;

&lt;P&gt;When i run following code&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   &amp;lt;html&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;meta charset="utf-8"&amp;gt;
    &amp;lt;title&amp;gt;How to start a Splunk session&amp;lt;/title&amp;gt;
    &amp;lt;!--&amp;lt;script type="text/javascript" src="/static/app/kaisers_weinberater/jquery.min.js"&amp;gt;&amp;lt;/script&amp;gt;--&amp;gt;
    &amp;lt;script type="text/javascript" src="/static/app/kaisers_weinberater/splunk-sdk-javascript/client/splunk.js"&amp;gt;&amp;lt;/script&amp;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: "admin",
            scheme: "https",
            host: "localhost",
            port:"8089",
            version:"5.0.1"
        }); 

// Retrieve the collection of jobs
var myJobs = service.jobs();

myJobs.fetch(function(err, jobs) {

  // Determine how many jobs are in the collection
  var jobsList = myJobs.list() || [];
  console.log("There are " + jobsList.length + " jobs available to the current user");

  // Loop through the collection and display each job's SID
  for(var i = 0; i &amp;lt; jobsList.length; i++) {
    console.log((i + 1) + ": " + jobsList[i].sid);
  };
});

    }
    &amp;lt;/script&amp;gt; 
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;button type="button" onclick="displayApps()"&amp;gt;Log in and list apps&amp;lt;/button&amp;gt;
    &amp;lt;p id="applist"&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;i get following error:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://localhost:8000/en-US/proxy/services/auth/login?output_mode=json"&gt;https://localhost:8000/en-US/proxy/services/auth/login?output_mode=json&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Any ideas? Thanks a lot for your help!:)&lt;/P&gt;</description>
      <pubDate>Sat, 26 Jan 2013 20:07:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Can-t-connect-to-splunk/m-p/101208#M1469</guid>
      <dc:creator>splunkjunkxx</dc:creator>
      <dc:date>2013-01-26T20:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: Can´t connect to splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Can-t-connect-to-splunk/m-p/101209#M1470</link>
      <description>&lt;P&gt;Edit Error: &lt;BR /&gt;
 &lt;A href="https://localhost:8000/en-US/proxy/services/auth/login?output_mode=json"&gt;https://localhost:8000/en-US/proxy/services/auth/login?output_mode=json&lt;/A&gt; 404 (Not Found)&lt;/P&gt;</description>
      <pubDate>Sat, 26 Jan 2013 20:12:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Can-t-connect-to-splunk/m-p/101209#M1470</guid>
      <dc:creator>splunkjunkxx</dc:creator>
      <dc:date>2013-01-26T20:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: Can´t connect to splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Can-t-connect-to-splunk/m-p/101210#M1471</link>
      <description>&lt;P&gt;I assume that you are running Splunk on the local machine, and that you are using port 8000 (the default)?&lt;/P&gt;</description>
      <pubDate>Sun, 27 Jan 2013 09:07:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Can-t-connect-to-splunk/m-p/101210#M1471</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-01-27T09:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: Can´t connect to splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Can-t-connect-to-splunk/m-p/101211#M1472</link>
      <description>&lt;P&gt;Hi Iguinn:) that´s right. Thought :8089 is the port for communication with the splunk server? How can i instantiate the http object without the proxy function? &lt;BR /&gt;
After changing this line to   var http = new splunkjs.ProxyHttp(".."); i get rid off the 404 error. But the response json data from splunkd is {"data": null, "total": 0, "messages": [{"message": "Invalid viewstate param name: username; aborting", "time": "2013-01-28T09:59:48", "type": "ERROR"}&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jan 2013 09:07:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Can-t-connect-to-splunk/m-p/101211#M1472</guid>
      <dc:creator>sinnixx</dc:creator>
      <dc:date>2013-01-28T09:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: Can´t connect to splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Can-t-connect-to-splunk/m-p/101212#M1473</link>
      <description>&lt;P&gt;The 404 seems to be related to the fact that the request isn't actually making it to Splunk. By default, browsers don't allow cross-site scripting - &lt;A href="http://en.wikipedia.org/wiki/Same_origin_policy"&gt;Same origin policy&lt;/A&gt;. You will need to tell your web server to proxy specific requests to Splunk. For example, when running apache, following 2 lines of code do the trick.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SSLProxyEngine On
ProxyPass   /proxy/             &lt;A href="https://localhost:8089/" target="test_blank"&gt;https://localhost:8089/&lt;/A&gt;&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jan 2013 17:02:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Can-t-connect-to-splunk/m-p/101212#M1473</guid>
      <dc:creator>Neeraj_Luthra</dc:creator>
      <dc:date>2013-01-28T17:02:13Z</dc:date>
    </item>
  </channel>
</rss>

