I have 2 servers:
Server1 (Debian) - prod server
Server2 (Ubuntu) - dev server
Both servers have a public IP address and a FQDN. They are not located in the company's premises, they are being kept in a datacenter, so I can run tests with real results.
I've been asked by a client whether an Splunk dashboard can be viewed outside Splunk Web, i.e., an html document served by Apache that retrieves the dashboard from another server. I found out about SplunkJS Stack and started running tests to see if I could fulfil the client's request. I've started here:
http://dev.splunk.com/view/web-framework/SP-CAAAER6
I am no dev, so I got a bit lost about the SDK. Besides, the client only wants to write an html doc, put it in Apache's root directory and access it from anywhere in the web without typing/passing Splunk's URL to other people. So I opted for SplunkJS Stack, seemed easier. I read these:
http://dev.splunk.com/view/SP-CAAAEWR
http://dev.splunk.com/view/SP-CAAAEW6
http://dev.splunk.com/view/SP-CAAAEWS
http://dev.splunk.com/view/SP-CAAAEV9
I thought about using Server2 to host the html docs with js code from the examples found in the above-mentioned docs (adapted) in order to request a previously saved html dashboard from Server1. Reading the docs, I decided to go with CORS since it required minimum changes in both servers (assuming some clients won't allow much changes - hope for the best, prepare etc.). Then the questions started piling up.
href="static/splunkjs/css/bootstrap.css"
to href="splunkjs/css/bootstrap.css"
. Was that assumption correct?baseUrl: "static/"
(should I change it to "/" or "./"?); host: "localhost"
(should localhost
be replaced by server1.x.com
, server2.x.com
or should I leave it like that?); var http = new jssdk.ProxyHttp("/proxy")
(should it be "/"? I am not using any proxy but if I try to get rid of the lines that follow it, the login function just after it throws an error - "service not defined
").server.conf
;...but if I try any of the test_xxx.html pages provided with the JSStack zip, even though I've been changing them in every possible way, the farthest I get is seeing in Firefox console the message "Login failed: No session key available".
I had all kinds of messages before, so I guess the corrections and assumptions worked for some things. I've already restarted the servers several times, closed browsers, cleaned chaches, changed browsers, to no avail. What am I missing here? Any help at this point would be greatly appreciated, for I've spent the best part of this week stuck with this problem.
Found the answer inside the README.MD file that comes with the JS zip file. The first step before anything should be changing the parameters in config.js to meet your needs, according to this link: http://docs.splunk.com/DocumentationStatic/WebFramework/1.1/compref_splunkjsconfig.html. The comments inside README.MD also help understanding what is to be changed and what's not.
Found the answer inside the README.MD file that comes with the JS zip file. The first step before anything should be changing the parameters in config.js to meet your needs, according to this link: http://docs.splunk.com/DocumentationStatic/WebFramework/1.1/compref_splunkjsconfig.html. The comments inside README.MD also help understanding what is to be changed and what's not.