Splunk Dev

Python end point configured in web.conf is not working

paramagurukarth
Builder

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.

1 Solution

paramagurukarth
Builder

Sorry.. Same set up works for me...
Previously I just configured the web.conf in $Splunk_Home$/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):
@expose_page(must_login=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

paramagurukarth
Builder

Sorry.. Same set up works for me...
Previously I just configured the web.conf in $Splunk_Home$/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):
@expose_page(must_login=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

amritanshgupta
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

kasu_praveen
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

paramagurukarth
Builder
0 Karma

kasu_praveen
Communicator

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

0 Karma

paramagurukarth
Builder

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

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...