<?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: Good example of a working custom REST endpoint (but not an admin:* one) in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Good-example-of-a-working-custom-REST-endpoint-but-not-an-admin/m-p/100078#M20908</link>
    <description>&lt;P&gt;Note: It looks like since I posted this the docs were updated to list the correct directory. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 13 May 2011 05:50:43 GMT</pubDate>
    <dc:creator>sideview</dc:creator>
    <dc:date>2011-05-13T05:50:43Z</dc:date>
    <item>
      <title>Good example of a working custom REST endpoint (but not an admin:* one)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Good-example-of-a-working-custom-REST-endpoint-but-not-an-admin/m-p/100076#M20906</link>
      <description>&lt;P&gt;I'm trying to piece things together from the restmap.conf docs, to get a working custom endpoint that I can use.  Note that i do not want to use this with setup.xml and I just want a plain old endpoint that extends &lt;CODE&gt;splunk.rest.BaseRestHandler&lt;/CODE&gt;, not an EAI endpoint. &lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/base/Documentation/4.2.1/admin/restmapconf" target="_blank"&gt;http://www.splunk.com/base/Documentation/4.2.1/admin/restmapconf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Following what's written in restmap.conf I think I've done everything right and I've read through the doc a few times, but no luck.    &lt;/P&gt;

&lt;P&gt;I get a 500 response when I go to &lt;CODE&gt;https://localhost:8089/services/my_path&lt;/CODE&gt;, saying "ImportError: No module named MyFileName" and I dont see how to debug or troubleshoot anything. &lt;/P&gt;

&lt;P&gt;Here's my stanza in restmap.conf: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[script:random_unique_name_like_say_fred]
match = /my_path
handler = MyFileName.MyClassName
requireAuthentication = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and in $SPLUNK_HOME/etc/apps/&lt;APP_NAME&gt;/default/rest/MyFileName.py   there is a class defined called MyClassName that extends splunk.rest.BaseRestHandler.     And the python is pretty simple and running it manually it seems free of syntax errors. &lt;/APP_NAME&gt;&lt;/P&gt;

&lt;P&gt;Ideally if someone can point me to an app on Splunkbase that has successfully set up a non-EAI custom rest endpoint (ie one that is NOT used from guided setup aka setup.xml). &lt;/P&gt;

&lt;P&gt;Failing that,  can anyone see what I'm doing wrong, or can you tell me if there are any tricks to get some kind of debugging or troubleshooting going?   &lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:33:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Good-example-of-a-working-custom-REST-endpoint-but-not-an-admin/m-p/100076#M20906</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2020-09-28T09:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: Good example of a working custom REST endpoint (but not an admin:* one)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Good-example-of-a-working-custom-REST-endpoint-but-not-an-admin/m-p/100077#M20907</link>
      <description>&lt;P&gt;It turns out that the restmap.conf docs are wrong in at least one place. &lt;BR /&gt;
Under &lt;CODE&gt;handler=&amp;lt;SCRIPT&amp;gt;.&amp;lt;CLASSNAME&amp;gt;&lt;/CODE&gt;,  they say &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;The file *must* live in an application's ../rest/ subdirectory.&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;and then in an example it explains further that this &lt;CODE&gt;rest&lt;/CODE&gt; directory has to be inside &lt;CODE&gt;default&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Both are wrong.  The file must live in the application's "bin" directory, at &lt;CODE&gt;$SPLUNK_HOME/etc/apps/&amp;lt;appname&amp;gt;/bin/&lt;/CODE&gt;.  Once I put it there it starts working. &lt;/P&gt;

&lt;P&gt;However I'll still accept any answer that points me to an app that does something semi-real around such an endpoint...   &lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2011 19:17:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Good-example-of-a-working-custom-REST-endpoint-but-not-an-admin/m-p/100077#M20907</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2011-05-11T19:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: Good example of a working custom REST endpoint (but not an admin:* one)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Good-example-of-a-working-custom-REST-endpoint-but-not-an-admin/m-p/100078#M20908</link>
      <description>&lt;P&gt;Note: It looks like since I posted this the docs were updated to list the correct directory. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2011 05:50:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Good-example-of-a-working-custom-REST-endpoint-but-not-an-admin/m-p/100078#M20908</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2011-05-13T05:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: Good example of a working custom REST endpoint (but not an admin:* one)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Good-example-of-a-working-custom-REST-endpoint-but-not-an-admin/m-p/100079#M20909</link>
      <description>&lt;P&gt;The &lt;A href="http://splunk-base.splunk.com/apps/22348/pdf-report-server-install-on-linux-only"&gt;pdfserver&lt;/A&gt; app implements a custom REST endpoint.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2011 19:03:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Good-example-of-a-working-custom-REST-endpoint-but-not-an-admin/m-p/100079#M20909</guid>
      <dc:creator>ziegfried</dc:creator>
      <dc:date>2011-06-08T19:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: Good example of a working custom REST endpoint (but not an admin:* one)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Good-example-of-a-working-custom-REST-endpoint-but-not-an-admin/m-p/744132#M118220</link>
      <description>&lt;P&gt;We've added documentation to dev.splunk.com to cover &lt;A href="https://dev.splunk.com/enterprise/docs/devtools/customrestendpoints/" target="_self"&gt;Custom REST Endpoints&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(apologies for thread necromancy but this is still one of the top hits on gsearch for this topic somehow, 14 years later)&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Apr 2025 19:40:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Good-example-of-a-working-custom-REST-endpoint-but-not-an-admin/m-p/744132#M118220</guid>
      <dc:creator>thellmann</dc:creator>
      <dc:date>2025-04-14T19:40:20Z</dc:date>
    </item>
  </channel>
</rss>

