<?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: Properties/Arguments in Endpoint URL for REST Modular Input in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/Properties-Arguments-in-Endpoint-URL-for-REST-Modular-Input/m-p/368301#M7160</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;You need to modify the bin/tokens.py UNDER the rest_ta app UNDE etc&lt;BR /&gt;
Steps:&lt;BR /&gt;
Configure REST Data Input&lt;BR /&gt;
Endpoint URL: https:///&amp;lt;1st_parameter&amp;gt;//token?api-version=$z$ (taking z as an token example, api version 7)&lt;BR /&gt;
URL Arguments: z=7&lt;BR /&gt;
now navigate to  bin/tokens.py UNDER the rest_ta app UNDE etc&lt;BR /&gt;
add something like&lt;BR /&gt;
def z():&lt;BR /&gt;
     z=7&lt;/P&gt;

&lt;H1&gt;     return z&lt;/H1&gt;

&lt;P&gt;repeat same steps for token.&lt;BR /&gt;
Try one dynamic parameter first..it will wok &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 16:03:02 GMT</pubDate>
    <dc:creator>Sukisen1981</dc:creator>
    <dc:date>2020-09-29T16:03:02Z</dc:date>
    <item>
      <title>Properties/Arguments in Endpoint URL for REST Modular Input</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Properties-Arguments-in-Endpoint-URL-for-REST-Modular-Input/m-p/368299#M7158</link>
      <description>&lt;P&gt;Hi Splunkers.&lt;BR /&gt;
I'm trying to set up a REST input to bring back output from an API.&lt;/P&gt;

&lt;P&gt;These are the parameters used to form the API Endpoint URL. i.e. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&lt;A href="https://&amp;lt;my_api_base_endpoint&amp;gt;/&amp;lt;1st_parameter&amp;gt;/&amp;lt;authtype&amp;gt;/token?api-version=&amp;lt;api_version&amp;gt;" target="test_blank"&gt;https://&amp;lt;my_api_base_endpoint&amp;gt;/&amp;lt;1st_parameter&amp;gt;/&amp;lt;authtype&amp;gt;/token?api-version=&amp;lt;api_version&amp;gt;&lt;/A&gt;;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In the above example I need to provide the above parameters to build the entire endpoint URL both before and after the "?" etc as opposed to hard-coding them in the endpoint URL field in the setup screen.&lt;/P&gt;

&lt;P&gt;The config screen in Splunk web config for the REST input provides an area for URL arguments and and HTTP Header properties but nothing used in either of these two areas seems to get substituted into the actual URL that Splunk calls when it tries to contact the endpoint.&lt;/P&gt;

&lt;P&gt;Any advice on where these parameters go so they can flesh out the endpoint URL when it's called?&lt;BR /&gt;
Note that the initial call to the API is a POST to get an access token with all subsequent calls being a GET.&lt;/P&gt;

&lt;P&gt;Finally, in case it's relevant to answering the question, this input will be running on a HF.&lt;/P&gt;

&lt;P&gt;Cheers and thanks in advance. &lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2017 04:55:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Properties-Arguments-in-Endpoint-URL-for-REST-Modular-Input/m-p/368299#M7158</guid>
      <dc:creator>splunk_svc</dc:creator>
      <dc:date>2017-09-28T04:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: Properties/Arguments in Endpoint URL for REST Modular Input</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Properties-Arguments-in-Endpoint-URL-for-REST-Modular-Input/m-p/368300#M7159</link>
      <description>&lt;P&gt;BTW, we are running v6.6.3 of Splunk Enterprise.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2017 05:19:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Properties-Arguments-in-Endpoint-URL-for-REST-Modular-Input/m-p/368300#M7159</guid>
      <dc:creator>splunk_svc</dc:creator>
      <dc:date>2017-09-28T05:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: Properties/Arguments in Endpoint URL for REST Modular Input</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Properties-Arguments-in-Endpoint-URL-for-REST-Modular-Input/m-p/368301#M7160</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;You need to modify the bin/tokens.py UNDER the rest_ta app UNDE etc&lt;BR /&gt;
Steps:&lt;BR /&gt;
Configure REST Data Input&lt;BR /&gt;
Endpoint URL: https:///&amp;lt;1st_parameter&amp;gt;//token?api-version=$z$ (taking z as an token example, api version 7)&lt;BR /&gt;
URL Arguments: z=7&lt;BR /&gt;
now navigate to  bin/tokens.py UNDER the rest_ta app UNDE etc&lt;BR /&gt;
add something like&lt;BR /&gt;
def z():&lt;BR /&gt;
     z=7&lt;/P&gt;

&lt;H1&gt;     return z&lt;/H1&gt;

&lt;P&gt;repeat same steps for token.&lt;BR /&gt;
Try one dynamic parameter first..it will wok &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:03:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Properties-Arguments-in-Endpoint-URL-for-REST-Modular-Input/m-p/368301#M7160</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2020-09-29T16:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: Properties/Arguments in Endpoint URL for REST Modular Input</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Properties-Arguments-in-Endpoint-URL-for-REST-Modular-Input/m-p/368302#M7161</link>
      <description>&lt;P&gt;Custom Response Handlers&lt;BR /&gt;
from Damien Dallimore himself - &lt;A href="https://splunkbase.splunk.com/app/1546/#/details"&gt;https://splunkbase.splunk.com/app/1546/#/details&lt;/A&gt;&lt;BR /&gt;
You can provide your own custom Response Handler. This is a Python class that you should add to the&lt;BR /&gt;
rest_ta/bin/responsehandlers.py module.&lt;BR /&gt;
You can then declare this class name and any parameters in the REST Input setup page.&lt;BR /&gt;
Such use cases for implementing a custom response handler might include&lt;BR /&gt;
    dynamic setting of URL arguments/HTTP header propertys ie: a stream cursor&lt;BR /&gt;
    extracting the next link to follow from the response content or HTTTP REL header&lt;BR /&gt;
    custom pre-processing of the raw HTTP response before indexing in Splunk&lt;BR /&gt;
    dynamically changing the REST endpoint URL&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2017 17:44:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Properties-Arguments-in-Endpoint-URL-for-REST-Modular-Input/m-p/368302#M7161</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2017-09-28T17:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: Properties/Arguments in Endpoint URL for REST Modular Input</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Properties-Arguments-in-Endpoint-URL-for-REST-Modular-Input/m-p/368303#M7162</link>
      <description>&lt;P&gt;If I understand the flow correctly , you might need to use a custom Auth Handler that will : &lt;/P&gt;

&lt;P&gt;1) check if you have an auth token yet&lt;BR /&gt;
2) if false , then perform a POST to get an auth token to the Auth URL and save this token for future GET calls&lt;BR /&gt;
3) if true , then proceed with a GET to your Data API URL with the saved token from step 2&lt;/P&gt;

&lt;P&gt;Is this correct ?  If so , can you respond with the format of your Auth URL and your Data API URL so I can give a more concrete configuration example ? Or is it simply the same URL from your example , just differentiated by it being a POST or a GET ?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2017 03:36:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Properties-Arguments-in-Endpoint-URL-for-REST-Modular-Input/m-p/368303#M7162</guid>
      <dc:creator>Damien_Dallimor</dc:creator>
      <dc:date>2017-09-29T03:36:09Z</dc:date>
    </item>
  </channel>
</rss>

