<?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: REST API Modular Input: how do I make a POST request with variables in the body? in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411496#M50200</link>
    <description>&lt;P&gt;So you can probably achieve something with a custom response handler.&lt;/P&gt;

&lt;P&gt;You will have specified your initial POST payload in your setup config.&lt;/P&gt;

&lt;P&gt;Then you can define a custom response handler ie: &lt;CODE&gt;PostDateHandler&lt;/CODE&gt; , that will update the date values upon each response.&lt;/P&gt;

&lt;P&gt;The updated POST payload will also get automatically persisted back to your &lt;CODE&gt;inputs.conf&lt;/CODE&gt; stanza to survive restarts.&lt;/P&gt;

&lt;P&gt;This custom response handler is a class you add to &lt;CODE&gt;rest_ta/bin/responsehandlers.py&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Examples to guide you below.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5883i3722D6DED2020D40/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;class PostDateHandler:

    def __init__(self,**args):
        pass

    def __call__(self, response_object,raw_response_output,response_type,req_args,endpoint):       

        #PSEUDO CODE ONLY TO GUIDE YOU , ADJUST AS NECESSARY

        #index HTTP response 
        print_xml_stream(raw_response_output)

        #get POST data
        if not "data" in req_args:
            post_data = {}
        else:
            post_data = json.loads(req_args["data"])

        #set new date to something
        new_from_date = "2018-09-05 00:00:00"
        new_to_date = "2018-10-05 00:00:00"
        post_data["fromDate"] = new_from_date
        post_data["toDate"] = new_to_date

        #update POST data
        req_args["data"] = json.dumps(post_data)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 13 Oct 2018 06:00:04 GMT</pubDate>
    <dc:creator>Damien_Dallimor</dc:creator>
    <dc:date>2018-10-13T06:00:04Z</dc:date>
    <item>
      <title>REST API Modular Input: how do I make a POST request with variables in the body?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411492#M50196</link>
      <description>&lt;P&gt;Hi community, &lt;/P&gt;

&lt;P&gt;We have a cloud Service from where we want to pull audit events. This REST API accepts in the request payload the date variable. We don't want to pull events that have already been pulled. This is an example to payload:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{ 
"fromDate": "2018-09-05 00:00:00",     
"toDate": "2018-10-05 23:59:00",     
"product": "XYZ",     
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;We need something like this that changes every day:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;fromDate_Variable = today – 2 days
$fromDate_Variable 
2018-09-03 00:00:00

toDate_variable=today – 1 day
$toDate_Variable 
2018-09-04 00:00:00
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This payload only pulled events for previous day and are changing every day.  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{ 
"fromDate": $ fromDate_Variable,     
"toDate": $toDate_Variable,     
"product": "XYZ",     
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Could you help me with any suggestions?&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 15:41:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411492#M50196</guid>
      <dc:creator>juanmjulio</dc:creator>
      <dc:date>2018-10-08T15:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: REST API Modular Input: how do I make a POST request with variables in the body?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411493#M50197</link>
      <description>&lt;P&gt;So you can probably achieve something with a custom response handler.&lt;/P&gt;

&lt;P&gt;You will have specified your initial POST payload in your setup config.&lt;/P&gt;

&lt;P&gt;Then you can define a custom response handler ie: &lt;CODE&gt;PostDateHandler&lt;/CODE&gt; , that will update the date values upon each response.&lt;/P&gt;

&lt;P&gt;The updated POST payload will also get automatically persisted back to your &lt;CODE&gt;inputs.conf&lt;/CODE&gt; stanza to survive restarts.&lt;/P&gt;

&lt;P&gt;This custom response handler is a class you add to &lt;CODE&gt;rest_ta/bin/responsehandlers.py&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Examples to guide you below.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;SEE OTHER ANSWER BELOW.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 19:44:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411493#M50197</guid>
      <dc:creator>Damien_Dallimor</dc:creator>
      <dc:date>2018-10-08T19:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: REST API Modular Input: how do I make a POST request with variables in the body?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411494#M50198</link>
      <description>&lt;P&gt;Thank you Damien - just a shame those examples aren't showing up...I am so keen &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2018 07:27:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411494#M50198</guid>
      <dc:creator>durandfr</dc:creator>
      <dc:date>2018-10-12T07:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: REST API Modular Input: how do I make a POST request with variables in the body?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411495#M50199</link>
      <description>&lt;P&gt;Hi Damien,&lt;/P&gt;

&lt;P&gt;I followed your suggestions, but doesn't worked, I seeing the next error:&lt;/P&gt;

&lt;P&gt;10-13-2018 01:21:42.089 -0300 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/rest_ta/bin/rest.py"     post_date["fromDate"] = new_from_date&lt;BR /&gt;
10-13-2018 01:21:42.089 -0300 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/rest_ta/bin/rest.py" TypeError: 'str' object does not support item assignment&lt;/P&gt;

&lt;P&gt;Could you help me with this?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:36:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411495#M50199</guid>
      <dc:creator>juanmjulio</dc:creator>
      <dc:date>2020-09-29T21:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: REST API Modular Input: how do I make a POST request with variables in the body?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411496#M50200</link>
      <description>&lt;P&gt;So you can probably achieve something with a custom response handler.&lt;/P&gt;

&lt;P&gt;You will have specified your initial POST payload in your setup config.&lt;/P&gt;

&lt;P&gt;Then you can define a custom response handler ie: &lt;CODE&gt;PostDateHandler&lt;/CODE&gt; , that will update the date values upon each response.&lt;/P&gt;

&lt;P&gt;The updated POST payload will also get automatically persisted back to your &lt;CODE&gt;inputs.conf&lt;/CODE&gt; stanza to survive restarts.&lt;/P&gt;

&lt;P&gt;This custom response handler is a class you add to &lt;CODE&gt;rest_ta/bin/responsehandlers.py&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Examples to guide you below.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5883i3722D6DED2020D40/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;class PostDateHandler:

    def __init__(self,**args):
        pass

    def __call__(self, response_object,raw_response_output,response_type,req_args,endpoint):       

        #PSEUDO CODE ONLY TO GUIDE YOU , ADJUST AS NECESSARY

        #index HTTP response 
        print_xml_stream(raw_response_output)

        #get POST data
        if not "data" in req_args:
            post_data = {}
        else:
            post_data = json.loads(req_args["data"])

        #set new date to something
        new_from_date = "2018-09-05 00:00:00"
        new_to_date = "2018-10-05 00:00:00"
        post_data["fromDate"] = new_from_date
        post_data["toDate"] = new_to_date

        #update POST data
        req_args["data"] = json.dumps(post_data)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 13 Oct 2018 06:00:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411496#M50200</guid>
      <dc:creator>Damien_Dallimor</dc:creator>
      <dc:date>2018-10-13T06:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: REST API Modular Input: how do I make a POST request with variables in the body?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411497#M50201</link>
      <description>&lt;P&gt;Reposted below. For some reason Splunkbase stripped the images and you can't re-add them in edit mode.&lt;/P&gt;</description>
      <pubDate>Sat, 13 Oct 2018 06:00:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411497#M50201</guid>
      <dc:creator>Damien_Dallimor</dc:creator>
      <dc:date>2018-10-13T06:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: REST API Modular Input: how do I make a POST request with variables in the body?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411498#M50202</link>
      <description>&lt;P&gt;The example is &lt;STRONG&gt;purely to guide you,&lt;/STRONG&gt; it is pseudo code , this is made very clear in the example.&lt;/P&gt;

&lt;P&gt;You will have to write your own python. You error indicates your python code is invalid.&lt;/P&gt;

&lt;P&gt;We are not going to write the code for you unless you have commercial support.&lt;/P&gt;

&lt;P&gt;I updated the pseduo code example below so you can now copy/paste it to get started (it was an image before)&lt;/P&gt;</description>
      <pubDate>Sat, 13 Oct 2018 06:07:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411498#M50202</guid>
      <dc:creator>Damien_Dallimor</dc:creator>
      <dc:date>2018-10-13T06:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: REST API Modular Input: how do I make a POST request with variables in the body?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411499#M50203</link>
      <description>&lt;P&gt;Many thanks Damien for the multiple pointers - now oddly enough, i am witnessing a change in behavior should I be updating the POST data, or not.  &lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;If I &lt;EM&gt;don't&lt;/EM&gt; and just parse a  json response, defined polling interval is respected - and I can trace a single  &lt;CODE&gt;New scheduled exec process: python /opt/splunk/etc/apps/rest_ta/bin/rest.py&lt;/CODE&gt; once inputs.conf stanza updated from Splunk GUI.&lt;/LI&gt;
&lt;LI&gt;If I do, polling interval is ignored and  &lt;CODE&gt;New scheduled exec process*&lt;/CODE&gt; start cropping up uncontrollably a few times per minute - furthermore, my updated POST json payload gets all messed up.&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 17 Oct 2018 16:45:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411499#M50203</guid>
      <dc:creator>durandfr</dc:creator>
      <dc:date>2018-10-17T16:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: REST API Modular Input: how do I make a POST request with variables in the body?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411500#M50204</link>
      <description>&lt;P&gt;Hi Damien,&lt;/P&gt;

&lt;P&gt;My mistake, I had syntax error in my code, now the post are changing but as mentioned durandfr, I seeing same behavior.&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 19:28:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411500#M50204</guid>
      <dc:creator>juanmjulio</dc:creator>
      <dc:date>2018-10-17T19:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: REST API Modular Input: how do I make a POST request with variables in the body?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411501#M50205</link>
      <description>&lt;P&gt;Most likely an error in your code / config.&lt;/P&gt;

&lt;P&gt;Any logging ? &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=_internal error rest.py&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 19:51:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411501#M50205</guid>
      <dc:creator>Damien_Dallimor</dc:creator>
      <dc:date>2018-10-17T19:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: REST API Modular Input: how do I make a POST request with variables in the body?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411502#M50206</link>
      <description>&lt;P&gt;I seeing recurrent errors like this, I check conectivity and is ok also I increase the timeout setting but the error persist aleatory way:&lt;/P&gt;

&lt;P&gt;ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/rest_ta/bin/rest.py" Exception performing request: HTTPSConnectionPool(host='xxxxx.fa.us.xxxx.com', port=443): Max retries exceeded with url: /fscmRestApi/fndAuditRESTService/audittrail/getaudithistory?D2=8&amp;amp;D1=7 (Caused by : [Errno 110] Connection timed out)&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 20:06:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411502#M50206</guid>
      <dc:creator>juanmjulio</dc:creator>
      <dc:date>2018-10-17T20:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: REST API Modular Input: how do I make a POST request with variables in the body?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411503#M50207</link>
      <description>&lt;P&gt;I would make a calculated guess that you have an error in any custom response handler code you have written.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 21:10:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411503#M50207</guid>
      <dc:creator>Damien_Dallimor</dc:creator>
      <dc:date>2018-10-17T21:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: REST API Modular Input: how do I make a POST request with variables in the body?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411504#M50208</link>
      <description>&lt;P&gt;OK, I see that my problem is that I'm using 2 variables as pointer (D1 and D2) to persist this to the inputs.conf even if splunk is restart, I´m using req_args["params"]["D1"] = "something", althoug this are saving in the inputs.conf also append to the end of URL request too, Do you know any way to keep any variable in inputs.conf without append to URL request?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 01:17:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411504#M50208</guid>
      <dc:creator>juanmjulio</dc:creator>
      <dc:date>2018-10-18T01:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: REST API Modular Input: how do I make a POST request with variables in the body?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411505#M50209</link>
      <description>&lt;P&gt;The default behavior is to automatically persist any changes to URL Parameters/Cookies/Request Headers/Post Data  back to inputs.conf.&lt;/P&gt;

&lt;P&gt;And whatever you set any of the above fields to in your custom response handler will be part of the next request in the main code in &lt;CODE&gt;rest.py&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 02:38:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411505#M50209</guid>
      <dc:creator>Damien_Dallimor</dc:creator>
      <dc:date>2018-10-19T02:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: REST API Modular Input: how do I make a POST request with variables in the body?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411506#M50210</link>
      <description>&lt;P&gt;Thanks, one more question, How can I update the value of some key in request handler arguments field ? &lt;BR /&gt;
I know that is possible to get the value as mentioned in &lt;A href="https://answers.splunk.com/answers/334524/accessing-response-handler-arguments-from-response-1.html"&gt;https://answers.splunk.com/answers/334524/accessing-response-handler-arguments-from-response-1.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 02:50:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411506#M50210</guid>
      <dc:creator>juanmjulio</dc:creator>
      <dc:date>2018-10-19T02:50:53Z</dc:date>
    </item>
    <item>
      <title>Re: REST API Modular Input: how do I make a POST request with variables in the body?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411507#M50211</link>
      <description>&lt;P&gt;You want to update the value of a key in &lt;CODE&gt;req_args["params"]&lt;/CODE&gt;  ?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;if "params" in req_args:
        req_args["params"]["D1"]  = "some new value"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Oct 2018 03:12:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411507#M50211</guid>
      <dc:creator>Damien_Dallimor</dc:creator>
      <dc:date>2018-10-19T03:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: REST API Modular Input: how do I make a POST request with variables in the body?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411508#M50212</link>
      <description>&lt;P&gt;Not, I want to update the key=value of response handlers arguments&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 03:19:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411508#M50212</guid>
      <dc:creator>juanmjulio</dc:creator>
      <dc:date>2018-10-19T03:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: REST API Modular Input: how do I make a POST request with variables in the body?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411509#M50213</link>
      <description>&lt;P&gt;I have no idea what you are asking now.&lt;/P&gt;

&lt;P&gt;Post commented code example  of what you are trying to accomplish.&lt;/P&gt;

&lt;P&gt;Is this what you mean ?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;class SomeResponseHandler:

    def __init__(self,**args):
        self.foo = args['foo']
        pass

    def __call__(self, response_object,raw_response_output,response_type,req_args,endpoint):

        self.foo = "some new value"
        print_xml_stream(raw_response_output)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Oct 2018 03:41:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411509#M50213</guid>
      <dc:creator>Damien_Dallimor</dc:creator>
      <dc:date>2018-10-19T03:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: REST API Modular Input: how do I make a POST request with variables in the body?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411510#M50214</link>
      <description>&lt;P&gt;I tested this code but not worked, I want to assign a value to args['foo'] = "some new value" and this value appear in response_handler_args from inputs.conf, and this value could change for this reason I need to modify this with some frecuency.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:43:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411510#M50214</guid>
      <dc:creator>juanmjulio</dc:creator>
      <dc:date>2020-09-29T21:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: REST API Modular Input: how do I make a POST request with variables in the body?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411511#M50215</link>
      <description>&lt;P&gt;As per previous reply  :  &lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;The default behavior is to automatically persist any changes to URL Parameters/Cookies/Request Headers/Post Data back to inputs.conf.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Instance variable parameters of response handlers do not get persisted to inputs.conf.&lt;BR /&gt;
Their intention is for configurable/declarative initialization of response handlers.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 05:26:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/REST-API-Modular-Input-how-do-I-make-a-POST-request-with/m-p/411511#M50215</guid>
      <dc:creator>Damien_Dallimor</dc:creator>
      <dc:date>2018-10-19T05:26:08Z</dc:date>
    </item>
  </channel>
</rss>

