<?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: Javascript SDK internal server error in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Javascript-SDK-internal-server-error/m-p/97718#M5377</link>
    <description>&lt;P&gt;Leave the proxy to be &lt;CODE&gt;"/proxy"&lt;/CODE&gt; as that matches your conf changes in MAMP's httpd.conf. The location you copied xml2json to is incorrect. You need to place it inside the &lt;CODE&gt;etc/apps&lt;/CODE&gt; folder on the server.&lt;/P&gt;

&lt;P&gt;Also, if you are using MAMP to serve the examples, you don't really need node at all.&lt;/P&gt;</description>
    <pubDate>Wed, 17 Apr 2013 15:08:41 GMT</pubDate>
    <dc:creator>Neeraj_Luthra</dc:creator>
    <dc:date>2013-04-17T15:08:41Z</dc:date>
    <item>
      <title>Javascript SDK internal server error</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Javascript-SDK-internal-server-error/m-p/97717#M5376</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;So I have splunk 4.2 installed on a remote server, I have downloaded the javascript SDK on my local machine, along with node v0.8.9.&lt;/P&gt;

&lt;P&gt;I copied the xml2json from my local machine to var/apps on the server.&lt;/P&gt;

&lt;P&gt;When I try to run the examples using node sdkdo examples, the example show in my local web browser.&lt;/P&gt;

&lt;P&gt;I have set up a proxy in my local apache web server (I use MAMP) like this:&lt;/P&gt;

&lt;P&gt;httpd.conf&lt;/P&gt;

&lt;P&gt;SSLProxyEngine On&lt;BR /&gt;
ProxyPass /proxy/ &lt;A href="https://My"&gt;https://My&lt;/A&gt; remote server&lt;/P&gt;

&lt;P&gt;I have enabled some stuff in this file:&lt;/P&gt;

&lt;P&gt;&lt;IFMODULE mod_headers.c=""&gt;&lt;BR /&gt;
    Header set Access-Control-Allow-Origin: *&lt;BR /&gt;
    Header set Access-Control-Allow-Methods: GET,POST,PUT,DELETE&lt;BR /&gt;
    Header set Access-Control-Allow-Headers: X-ProxyDestination,Authorization&lt;BR /&gt;
&lt;/IFMODULE&gt;&lt;/P&gt;

&lt;P&gt;To allow AJAX  cross domain request.&lt;/P&gt;

&lt;P&gt;When I hit the Run button of the example, I get this:&lt;/P&gt;

&lt;P&gt;POST &lt;A href="http://localhost:6969/proxy/services/auth/login?output_mode=json"&gt;http://localhost:6969/proxy/services/auth/login?output_mode=json&lt;/A&gt; 500 (Internal Server Error) &lt;/P&gt;

&lt;P&gt;When I try to edit the index.html example and replace the line&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var http = new splunkjs.ProxyHttp("/proxy");
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;with &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var http = new splunkjs.ProxyHttp("http://localhost/proxy");
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get this error&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;(MAMP active):&lt;/STRONG&gt;&lt;BR /&gt;
OPTIONS &lt;A href="http://localhost/proxy/services/auth/login?output_mode=json"&gt;http://localhost/proxy/services/auth/login?output_mode=json&lt;/A&gt; 200 (OK) jquery.min.js:4&lt;BR /&gt;
POST &lt;A href="http://localhost/proxy/services/auth/login?output_mode=json"&gt;http://localhost/proxy/services/auth/login?output_mode=json&lt;/A&gt; 404 (Not Found)&lt;BR /&gt;
&lt;STRONG&gt;(MAMP inactive)&lt;/STRONG&gt;&lt;BR /&gt;
OPTIONS &lt;A href="http://localhost/proxy/services/auth/login?output_mode=json"&gt;http://localhost/proxy/services/auth/login?output_mode=json&lt;/A&gt; Resource failed to load &lt;/P&gt;

&lt;P&gt;I don't know what's going on. I am not a server guy, nor a js developper, but I try to do my best to make it works.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2013 14:21:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Javascript-SDK-internal-server-error/m-p/97717#M5376</guid>
      <dc:creator>guilhem</dc:creator>
      <dc:date>2013-04-17T14:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: Javascript SDK internal server error</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Javascript-SDK-internal-server-error/m-p/97718#M5377</link>
      <description>&lt;P&gt;Leave the proxy to be &lt;CODE&gt;"/proxy"&lt;/CODE&gt; as that matches your conf changes in MAMP's httpd.conf. The location you copied xml2json to is incorrect. You need to place it inside the &lt;CODE&gt;etc/apps&lt;/CODE&gt; folder on the server.&lt;/P&gt;

&lt;P&gt;Also, if you are using MAMP to serve the examples, you don't really need node at all.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2013 15:08:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Javascript-SDK-internal-server-error/m-p/97718#M5377</guid>
      <dc:creator>Neeraj_Luthra</dc:creator>
      <dc:date>2013-04-17T15:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: Javascript SDK internal server error</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Javascript-SDK-internal-server-error/m-p/97719#M5378</link>
      <description>&lt;P&gt;Sorry didn't check it but I have the xml2json in the right place (/etc/apps)&lt;/P&gt;

&lt;P&gt;I really don't understand how to set up everything here (can't understand this page: &lt;A href="http://dev.splunk.com/view/SP-CAAAEFM"&gt;http://dev.splunk.com/view/SP-CAAAEFM&lt;/A&gt;, last paragraph)&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2013 16:23:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Javascript-SDK-internal-server-error/m-p/97719#M5378</guid>
      <dc:creator>guilhem</dc:creator>
      <dc:date>2013-04-17T16:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: Javascript SDK internal server error</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Javascript-SDK-internal-server-error/m-p/97720#M5379</link>
      <description>&lt;P&gt;I assume you are referring to the cross-domain paragraph.&lt;/P&gt;

&lt;P&gt;The MAMP httpd.conf should have these lines,&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;SSLProxyEngine On&lt;BR /&gt;
ProxyPass   /proxy/ &lt;A href="https://localhost:8089/"&gt;https://localhost:8089/&lt;/A&gt;&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;And after you restart MAMP, it should proxy the requests for Splunk correctly. Did you have the port defined in httpd.conf? Try the lines above and see if it works (assuming your Splunk is running locally on default ports, i.e. 8000 for UI and 8089 for management)&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2013 17:14:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Javascript-SDK-internal-server-error/m-p/97720#M5379</guid>
      <dc:creator>Neeraj_Luthra</dc:creator>
      <dc:date>2013-04-17T17:14:54Z</dc:date>
    </item>
  </channel>
</rss>

