|
Hello, I try to use sdk javascript client side so I've splunk on my host where I add the app JSON2 and I have my project on eclipse where I copy the folder client and jquery.min.js. I want to connect to my local splunk so I have test this:
But I've the alert "Error listing apps" and the error is :
And it's say that it's in jquery.min.js that there is the error and I do'nt know why is localhost:8080 and not 8089????? Thx by advance if you know where is come from the error. Laura, |
|
The problem you're having is due to the browser's Single Origin Policy (http://en.wikipedia.org/wiki/Same_origin_policy). The specific issue is that your page is going to be running of yourawesomedomain.com, but Splunk will be running on some separate domain (e.g. yourawesomedomain.com:8089), and the browser does not allow communication to happen between those two. The solution is to use a server-side proxy to relay the messages. For example, when you run the examples in the SDK, we start up a small webserver that proxies any request to the the "/proxy" endpoint to Splunk. You can similarly have a small proxy in your webserver that does the same. If you can say a bit more about your environment (what programming language you're using server side, what webserver, etc), I can give a bit more specific advice and help. Hello, Thanks very much for your answer. So, if I understand, I have to add a proxy in my apache (I work with a tomcat apache) and eclipse. I program in java. So I create a proxy of my choice. Then what have I to change in my dynamic web java project? And next I just to add the proxy in my browser? Thx by advance, Laura
(08 Aug '12, 08:46)
LauraBre
2
You can try adding the following two lines to your Apache config file: SSLProxyEngine On ProxyPass /proxy/ https://localhost:4089/ You will need to change localhost:4089 to wherever your splunkd is (the management host and port). Once you do that, any request that goes to /proxy on your server will be routed to your splunkd installation.
(10 Aug '12, 10:54)
ineeman
Thx, I did it. I insert my index.html in htdocs of my apache and I add SSLProxyEngine On ProxyPass /proxy/ https://localhost:8089/ in the Apache config file and decommented all modules about proxy. So it works cery well when I doen't use tomcat but when I use tomcat and Apache, there is the error 404 so I don't result the problem with tomcat but I can connect to my spolunk so it's a good thing. Now I want to use this in a dynamic web project where I use tomcat so I search I can I do it? Do you have an idea? Thx by advance, Laura
(13 Aug '12, 08:29)
LauraBre
|