Developing for Splunk Enterprise
Highlighted

Python end point configured in web.conf is not working

I am just trying to make a python method to respond for a http request (Interact with python using javascript).
I got an url from splunk wiki
The configuration given in that url is
1. Create an app with my python module inside controllers folder
2. In web.conf create a endpoint as [endpoint:]
3. just restart. The method inside the puython module can be accessed through the url
./custom///
4. Restart and login again

But, even after doing the above configuration URL of the above pattern is not available.
Anyone Please share your knoledge related to this.

Thanks.

Highlighted

Re: Python end point configured in web.conf is not working

Sorry.. Same set up works for me...
Previously I just configured the web.conf in $SplunkHome$/etc/system/local..
Now I did the same configuration inside $Splunk
Home$/etc/apps//default. It works and my python function is working as a listener for a http request (http:/ip:/custom///)

web.conf :
[endpoint:netutils] #Name of the python file

netutils.py
import cherrypy
import splunk.appserver.mrsparkle.controllers as controllers
from splunk.appserver.mrsparkle.lib.decorators import expose_page
from splunk.appserver.mrsparkle.lib.routes import route

class MyControllerController(controllers.BaseController):
@exposepage(mustlogin=True)
def listenerGet(self, **kwargs):
cherrypy.response.headers['Content-Type'] = 'text/plain'
return 'I am responding for your request'

Please refer http://wiki.splunk.com/Community:40GUIDevelopment

View solution in original post

Highlighted

Re: Python end point configured in web.conf is not working

Communicator

Hi paramagurukarthikeyan, Thanks for posting this. I am also looking similar one like this.
couple of clarifications.

1, How you called "MyPython.py" in your HTML view page?
2. You mentioned endpoint as "netutils", But where are you using this?, I am not seeing this in .py file.

Thanks for your time.

0 Karma
Highlighted

Re: Python end point configured in web.conf is not working

Communicator

Got answers for my above questions in another thread link text. Thanks

0 Karma
Highlighted

Re: Python end point configured in web.conf is not working

Sorry, I couldn't help you.. I just saw 🙂

0 Karma

Re: Python end point configured in web.conf is not working

0 Karma
Highlighted

Re: Python end point configured in web.conf is not working

Explorer

I can't get this to work. Is it not supported in 6.4.x and above?
The documentation you've linked to in another answer is of Splunk 4.x
I always get a error 404, even when I tried to run your exact code. Anyway I can fix this?

Thanks

0 Karma